@superatomai/sdk-node 0.0.64 → 0.0.66
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 +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +22 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -32
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2478,9 +2478,11 @@ var BookmarksRequestMessageSchema = z3.object({
|
|
|
2478
2478
|
});
|
|
2479
2479
|
var ArtifactsQueryFiltersSchema = z3.object({
|
|
2480
2480
|
createdBy: z3.number().optional(),
|
|
2481
|
+
type: z3.string().optional(),
|
|
2481
2482
|
status: z3.string().optional(),
|
|
2482
2483
|
name: z3.string().optional(),
|
|
2483
|
-
deleted: z3.boolean().optional()
|
|
2484
|
+
deleted: z3.boolean().optional(),
|
|
2485
|
+
createdAt: z3.string().optional()
|
|
2484
2486
|
});
|
|
2485
2487
|
var ArtifactsRequestPayloadSchema = z3.object({
|
|
2486
2488
|
operation: z3.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
|
|
@@ -2492,6 +2494,7 @@ var ArtifactsRequestPayloadSchema = z3.object({
|
|
|
2492
2494
|
status: z3.string().optional(),
|
|
2493
2495
|
deleted: z3.boolean().optional(),
|
|
2494
2496
|
limit: z3.number().optional(),
|
|
2497
|
+
offset: z3.number().optional(),
|
|
2495
2498
|
// Query operation fields
|
|
2496
2499
|
filters: ArtifactsQueryFiltersSchema.optional(),
|
|
2497
2500
|
sort: z3.enum(["ASC", "DESC"]).optional(),
|
|
@@ -6406,7 +6409,6 @@ ${executedToolsText}`);
|
|
|
6406
6409
|
logCollector?.info("Matching components from text response...");
|
|
6407
6410
|
let fullResponseText = "";
|
|
6408
6411
|
let answerComponentExtracted = false;
|
|
6409
|
-
let validatedAnswerComponent = null;
|
|
6410
6412
|
const answerCallback = componentStreamCallback;
|
|
6411
6413
|
const partialCallback = answerCallback ? (chunk) => {
|
|
6412
6414
|
fullResponseText += chunk;
|
|
@@ -6497,10 +6499,6 @@ ${executedToolsText}`);
|
|
|
6497
6499
|
if (currentQuery !== answerQuery) {
|
|
6498
6500
|
answerComponent.props.query = currentQuery;
|
|
6499
6501
|
}
|
|
6500
|
-
validatedAnswerComponent = {
|
|
6501
|
-
componentId: answerComponentData.componentId,
|
|
6502
|
-
validatedQuery: currentQuery
|
|
6503
|
-
};
|
|
6504
6502
|
logger.info(`[${this.getProviderName()}] \u2713 Answer component query validated (attempt ${attempts}) - STREAMING TO FRONTEND NOW`);
|
|
6505
6503
|
logCollector?.info(`\u2713 Answer component query validated - streaming to frontend`);
|
|
6506
6504
|
logger.info(`[${this.getProviderName()}] Calling answerCallback for: ${answerComponent.name}`);
|
|
@@ -6600,10 +6598,6 @@ ${executedToolsText}`);
|
|
|
6600
6598
|
return null;
|
|
6601
6599
|
}
|
|
6602
6600
|
let cleanedProps = { ...mc.props };
|
|
6603
|
-
if (validatedAnswerComponent && mc.componentId === validatedAnswerComponent.componentId) {
|
|
6604
|
-
logger.info(`[${this.getProviderName()}] Using pre-validated query for answer component: ${mc.componentId}`);
|
|
6605
|
-
cleanedProps.query = validatedAnswerComponent.validatedQuery;
|
|
6606
|
-
}
|
|
6607
6601
|
if (cleanedProps.externalTool) {
|
|
6608
6602
|
const toolId = cleanedProps.externalTool.toolId;
|
|
6609
6603
|
const validToolIds = (executedTools || []).map((t) => t.id);
|
|
@@ -11024,30 +11018,25 @@ async function handleArtifactsRequest(data, collections, sendMessage) {
|
|
|
11024
11018
|
const name = requestData?.name;
|
|
11025
11019
|
const createdBy = requestData?.createdBy;
|
|
11026
11020
|
const dsl = requestData?.dsl;
|
|
11021
|
+
const type = requestData?.type;
|
|
11022
|
+
const filters = requestData?.filters;
|
|
11027
11023
|
const status = requestData?.status;
|
|
11028
11024
|
const deleted = requestData?.deleted;
|
|
11029
11025
|
const limit = requestData?.limit;
|
|
11030
|
-
const
|
|
11026
|
+
const offset = requestData?.offset;
|
|
11031
11027
|
const sort = requestData?.sort;
|
|
11032
|
-
|
|
11033
|
-
const menuId = requestData?.menuId;
|
|
11034
|
-
const artifactGroupName = requestData?.artifactGroupName;
|
|
11035
|
-
const artifactGroupId = requestData?.artifactGroupId;
|
|
11036
|
-
const artifactGroupIcon = requestData?.artifactGroupIcon;
|
|
11037
|
-
logger.info("[SDK-NODEJS] Extracted params for create:", JSON.stringify({
|
|
11028
|
+
logger.info("[SDK-NODEJS] Extracted params:", JSON.stringify({
|
|
11038
11029
|
name,
|
|
11039
11030
|
type,
|
|
11040
|
-
|
|
11041
|
-
artifactGroupName,
|
|
11042
|
-
artifactGroupId,
|
|
11043
|
-
artifactGroupIcon
|
|
11031
|
+
filters: filters ? "present" : "undefined"
|
|
11044
11032
|
}, null, 2));
|
|
11033
|
+
logger.info("[SDK-NODEJS] Full requestData.filters:", JSON.stringify(filters, null, 2));
|
|
11045
11034
|
switch (operation) {
|
|
11046
11035
|
case "create":
|
|
11047
|
-
await handleCreate6(id, name, createdBy, dsl,
|
|
11036
|
+
await handleCreate6(id, name, createdBy, dsl, type, filters, status, executeCollection, sendMessage, from.id);
|
|
11048
11037
|
break;
|
|
11049
11038
|
case "update":
|
|
11050
|
-
await handleUpdate6(id, artifactId, name, dsl, status, deleted, executeCollection, sendMessage, from.id);
|
|
11039
|
+
await handleUpdate6(id, artifactId, name, dsl, type, filters, status, deleted, executeCollection, sendMessage, from.id);
|
|
11051
11040
|
break;
|
|
11052
11041
|
case "delete":
|
|
11053
11042
|
await handleDelete6(id, artifactId, executeCollection, sendMessage, from.id);
|
|
@@ -11059,7 +11048,7 @@ async function handleArtifactsRequest(data, collections, sendMessage) {
|
|
|
11059
11048
|
await handleGetOne6(id, artifactId, executeCollection, sendMessage, from.id);
|
|
11060
11049
|
break;
|
|
11061
11050
|
case "query":
|
|
11062
|
-
await handleQuery6(id, { filters, limit, sort }, executeCollection, sendMessage, from.id);
|
|
11051
|
+
await handleQuery6(id, { filters, limit, offset, sort }, executeCollection, sendMessage, from.id);
|
|
11063
11052
|
break;
|
|
11064
11053
|
default:
|
|
11065
11054
|
sendResponse8(id, {
|
|
@@ -11075,7 +11064,7 @@ async function handleArtifactsRequest(data, collections, sendMessage) {
|
|
|
11075
11064
|
}, sendMessage);
|
|
11076
11065
|
}
|
|
11077
11066
|
}
|
|
11078
|
-
async function handleCreate6(id, name, createdBy, dsl,
|
|
11067
|
+
async function handleCreate6(id, name, createdBy, dsl, type, filters, status, executeCollection, sendMessage, clientId) {
|
|
11079
11068
|
if (!name) {
|
|
11080
11069
|
sendResponse8(id, {
|
|
11081
11070
|
success: false,
|
|
@@ -11088,12 +11077,9 @@ async function handleCreate6(id, name, createdBy, dsl, status, type, menuId, art
|
|
|
11088
11077
|
name,
|
|
11089
11078
|
createdBy,
|
|
11090
11079
|
dsl,
|
|
11091
|
-
status,
|
|
11092
11080
|
type,
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
artifactGroupId,
|
|
11096
|
-
artifactGroupIcon
|
|
11081
|
+
filters,
|
|
11082
|
+
status
|
|
11097
11083
|
});
|
|
11098
11084
|
sendResponse8(id, {
|
|
11099
11085
|
success: true,
|
|
@@ -11108,7 +11094,7 @@ async function handleCreate6(id, name, createdBy, dsl, status, type, menuId, art
|
|
|
11108
11094
|
}, sendMessage, clientId);
|
|
11109
11095
|
}
|
|
11110
11096
|
}
|
|
11111
|
-
async function handleUpdate6(id, artifactId, name, dsl, status, deleted, executeCollection, sendMessage, clientId) {
|
|
11097
|
+
async function handleUpdate6(id, artifactId, name, dsl, type, filters, status, deleted, executeCollection, sendMessage, clientId) {
|
|
11112
11098
|
if (!artifactId) {
|
|
11113
11099
|
sendResponse8(id, {
|
|
11114
11100
|
success: false,
|
|
@@ -11117,7 +11103,7 @@ async function handleUpdate6(id, artifactId, name, dsl, status, deleted, execute
|
|
|
11117
11103
|
return;
|
|
11118
11104
|
}
|
|
11119
11105
|
try {
|
|
11120
|
-
const result = await executeCollection("artifacts", "update", { id: artifactId, name, dsl, status, deleted });
|
|
11106
|
+
const result = await executeCollection("artifacts", "update", { id: artifactId, name, dsl, type, filters, status, deleted });
|
|
11121
11107
|
sendResponse8(id, {
|
|
11122
11108
|
success: true,
|
|
11123
11109
|
data: result.data,
|
|
@@ -11196,11 +11182,15 @@ async function handleGetOne6(id, artifactId, executeCollection, sendMessage, cli
|
|
|
11196
11182
|
}
|
|
11197
11183
|
async function handleQuery6(id, queryParams, executeCollection, sendMessage, clientId) {
|
|
11198
11184
|
try {
|
|
11185
|
+
logger.info("[SDK-NODEJS] handleQuery - queryParams:", JSON.stringify(queryParams, null, 2));
|
|
11186
|
+
logger.info("[SDK-NODEJS] handleQuery - filters.type:", queryParams.filters?.type);
|
|
11199
11187
|
const result = await executeCollection("artifacts", "query", {
|
|
11200
11188
|
filters: queryParams.filters,
|
|
11201
11189
|
limit: queryParams.limit || 50,
|
|
11190
|
+
offset: queryParams.offset || 0,
|
|
11202
11191
|
sort: queryParams.sort || "DESC"
|
|
11203
11192
|
});
|
|
11193
|
+
logger.info("[SDK-NODEJS] handleQuery - executeCollection result count:", result.count);
|
|
11204
11194
|
sendResponse8(id, {
|
|
11205
11195
|
success: true,
|
|
11206
11196
|
data: result.data,
|