@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.d.mts
CHANGED
|
@@ -943,9 +943,9 @@ declare const KbNodesRequestPayloadSchema: z.ZodObject<{
|
|
|
943
943
|
} | undefined;
|
|
944
944
|
createdBy?: number | undefined;
|
|
945
945
|
updatedBy?: number | undefined;
|
|
946
|
+
offset?: number | undefined;
|
|
946
947
|
tags?: string[] | undefined;
|
|
947
948
|
content?: string | undefined;
|
|
948
|
-
offset?: number | undefined;
|
|
949
949
|
}, {
|
|
950
950
|
id?: number | undefined;
|
|
951
951
|
type?: "query" | "user" | "global" | undefined;
|
|
@@ -963,9 +963,9 @@ declare const KbNodesRequestPayloadSchema: z.ZodObject<{
|
|
|
963
963
|
} | undefined;
|
|
964
964
|
createdBy?: number | undefined;
|
|
965
965
|
updatedBy?: number | undefined;
|
|
966
|
+
offset?: number | undefined;
|
|
966
967
|
tags?: string[] | undefined;
|
|
967
968
|
content?: string | undefined;
|
|
968
|
-
offset?: number | undefined;
|
|
969
969
|
}>>;
|
|
970
970
|
}, "strip", z.ZodTypeAny, {
|
|
971
971
|
operation: "create" | "getOne" | "update" | "delete" | "getAll" | "search" | "getByCategory" | "getByUser" | "getCategories" | "getTags";
|
|
@@ -986,9 +986,9 @@ declare const KbNodesRequestPayloadSchema: z.ZodObject<{
|
|
|
986
986
|
} | undefined;
|
|
987
987
|
createdBy?: number | undefined;
|
|
988
988
|
updatedBy?: number | undefined;
|
|
989
|
+
offset?: number | undefined;
|
|
989
990
|
tags?: string[] | undefined;
|
|
990
991
|
content?: string | undefined;
|
|
991
|
-
offset?: number | undefined;
|
|
992
992
|
} | undefined;
|
|
993
993
|
}, {
|
|
994
994
|
operation: "create" | "getOne" | "update" | "delete" | "getAll" | "search" | "getByCategory" | "getByUser" | "getCategories" | "getTags";
|
|
@@ -1009,9 +1009,9 @@ declare const KbNodesRequestPayloadSchema: z.ZodObject<{
|
|
|
1009
1009
|
} | undefined;
|
|
1010
1010
|
createdBy?: number | undefined;
|
|
1011
1011
|
updatedBy?: number | undefined;
|
|
1012
|
+
offset?: number | undefined;
|
|
1012
1013
|
tags?: string[] | undefined;
|
|
1013
1014
|
content?: string | undefined;
|
|
1014
|
-
offset?: number | undefined;
|
|
1015
1015
|
} | undefined;
|
|
1016
1016
|
}>;
|
|
1017
1017
|
type KbNodesRequestPayload = z.infer<typeof KbNodesRequestPayloadSchema>;
|
package/dist/index.d.ts
CHANGED
|
@@ -943,9 +943,9 @@ declare const KbNodesRequestPayloadSchema: z.ZodObject<{
|
|
|
943
943
|
} | undefined;
|
|
944
944
|
createdBy?: number | undefined;
|
|
945
945
|
updatedBy?: number | undefined;
|
|
946
|
+
offset?: number | undefined;
|
|
946
947
|
tags?: string[] | undefined;
|
|
947
948
|
content?: string | undefined;
|
|
948
|
-
offset?: number | undefined;
|
|
949
949
|
}, {
|
|
950
950
|
id?: number | undefined;
|
|
951
951
|
type?: "query" | "user" | "global" | undefined;
|
|
@@ -963,9 +963,9 @@ declare const KbNodesRequestPayloadSchema: z.ZodObject<{
|
|
|
963
963
|
} | undefined;
|
|
964
964
|
createdBy?: number | undefined;
|
|
965
965
|
updatedBy?: number | undefined;
|
|
966
|
+
offset?: number | undefined;
|
|
966
967
|
tags?: string[] | undefined;
|
|
967
968
|
content?: string | undefined;
|
|
968
|
-
offset?: number | undefined;
|
|
969
969
|
}>>;
|
|
970
970
|
}, "strip", z.ZodTypeAny, {
|
|
971
971
|
operation: "create" | "getOne" | "update" | "delete" | "getAll" | "search" | "getByCategory" | "getByUser" | "getCategories" | "getTags";
|
|
@@ -986,9 +986,9 @@ declare const KbNodesRequestPayloadSchema: z.ZodObject<{
|
|
|
986
986
|
} | undefined;
|
|
987
987
|
createdBy?: number | undefined;
|
|
988
988
|
updatedBy?: number | undefined;
|
|
989
|
+
offset?: number | undefined;
|
|
989
990
|
tags?: string[] | undefined;
|
|
990
991
|
content?: string | undefined;
|
|
991
|
-
offset?: number | undefined;
|
|
992
992
|
} | undefined;
|
|
993
993
|
}, {
|
|
994
994
|
operation: "create" | "getOne" | "update" | "delete" | "getAll" | "search" | "getByCategory" | "getByUser" | "getCategories" | "getTags";
|
|
@@ -1009,9 +1009,9 @@ declare const KbNodesRequestPayloadSchema: z.ZodObject<{
|
|
|
1009
1009
|
} | undefined;
|
|
1010
1010
|
createdBy?: number | undefined;
|
|
1011
1011
|
updatedBy?: number | undefined;
|
|
1012
|
+
offset?: number | undefined;
|
|
1012
1013
|
tags?: string[] | undefined;
|
|
1013
1014
|
content?: string | undefined;
|
|
1014
|
-
offset?: number | undefined;
|
|
1015
1015
|
} | undefined;
|
|
1016
1016
|
}>;
|
|
1017
1017
|
type KbNodesRequestPayload = z.infer<typeof KbNodesRequestPayloadSchema>;
|
package/dist/index.js
CHANGED
|
@@ -2529,9 +2529,11 @@ var BookmarksRequestMessageSchema = import_zod3.z.object({
|
|
|
2529
2529
|
});
|
|
2530
2530
|
var ArtifactsQueryFiltersSchema = import_zod3.z.object({
|
|
2531
2531
|
createdBy: import_zod3.z.number().optional(),
|
|
2532
|
+
type: import_zod3.z.string().optional(),
|
|
2532
2533
|
status: import_zod3.z.string().optional(),
|
|
2533
2534
|
name: import_zod3.z.string().optional(),
|
|
2534
|
-
deleted: import_zod3.z.boolean().optional()
|
|
2535
|
+
deleted: import_zod3.z.boolean().optional(),
|
|
2536
|
+
createdAt: import_zod3.z.string().optional()
|
|
2535
2537
|
});
|
|
2536
2538
|
var ArtifactsRequestPayloadSchema = import_zod3.z.object({
|
|
2537
2539
|
operation: import_zod3.z.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
|
|
@@ -2543,6 +2545,7 @@ var ArtifactsRequestPayloadSchema = import_zod3.z.object({
|
|
|
2543
2545
|
status: import_zod3.z.string().optional(),
|
|
2544
2546
|
deleted: import_zod3.z.boolean().optional(),
|
|
2545
2547
|
limit: import_zod3.z.number().optional(),
|
|
2548
|
+
offset: import_zod3.z.number().optional(),
|
|
2546
2549
|
// Query operation fields
|
|
2547
2550
|
filters: ArtifactsQueryFiltersSchema.optional(),
|
|
2548
2551
|
sort: import_zod3.z.enum(["ASC", "DESC"]).optional(),
|
|
@@ -6457,7 +6460,6 @@ ${executedToolsText}`);
|
|
|
6457
6460
|
logCollector?.info("Matching components from text response...");
|
|
6458
6461
|
let fullResponseText = "";
|
|
6459
6462
|
let answerComponentExtracted = false;
|
|
6460
|
-
let validatedAnswerComponent = null;
|
|
6461
6463
|
const answerCallback = componentStreamCallback;
|
|
6462
6464
|
const partialCallback = answerCallback ? (chunk) => {
|
|
6463
6465
|
fullResponseText += chunk;
|
|
@@ -6548,10 +6550,6 @@ ${executedToolsText}`);
|
|
|
6548
6550
|
if (currentQuery !== answerQuery) {
|
|
6549
6551
|
answerComponent.props.query = currentQuery;
|
|
6550
6552
|
}
|
|
6551
|
-
validatedAnswerComponent = {
|
|
6552
|
-
componentId: answerComponentData.componentId,
|
|
6553
|
-
validatedQuery: currentQuery
|
|
6554
|
-
};
|
|
6555
6553
|
logger.info(`[${this.getProviderName()}] \u2713 Answer component query validated (attempt ${attempts}) - STREAMING TO FRONTEND NOW`);
|
|
6556
6554
|
logCollector?.info(`\u2713 Answer component query validated - streaming to frontend`);
|
|
6557
6555
|
logger.info(`[${this.getProviderName()}] Calling answerCallback for: ${answerComponent.name}`);
|
|
@@ -6651,10 +6649,6 @@ ${executedToolsText}`);
|
|
|
6651
6649
|
return null;
|
|
6652
6650
|
}
|
|
6653
6651
|
let cleanedProps = { ...mc.props };
|
|
6654
|
-
if (validatedAnswerComponent && mc.componentId === validatedAnswerComponent.componentId) {
|
|
6655
|
-
logger.info(`[${this.getProviderName()}] Using pre-validated query for answer component: ${mc.componentId}`);
|
|
6656
|
-
cleanedProps.query = validatedAnswerComponent.validatedQuery;
|
|
6657
|
-
}
|
|
6658
6652
|
if (cleanedProps.externalTool) {
|
|
6659
6653
|
const toolId = cleanedProps.externalTool.toolId;
|
|
6660
6654
|
const validToolIds = (executedTools || []).map((t) => t.id);
|
|
@@ -11075,30 +11069,25 @@ async function handleArtifactsRequest(data, collections, sendMessage) {
|
|
|
11075
11069
|
const name = requestData?.name;
|
|
11076
11070
|
const createdBy = requestData?.createdBy;
|
|
11077
11071
|
const dsl = requestData?.dsl;
|
|
11072
|
+
const type = requestData?.type;
|
|
11073
|
+
const filters = requestData?.filters;
|
|
11078
11074
|
const status = requestData?.status;
|
|
11079
11075
|
const deleted = requestData?.deleted;
|
|
11080
11076
|
const limit = requestData?.limit;
|
|
11081
|
-
const
|
|
11077
|
+
const offset = requestData?.offset;
|
|
11082
11078
|
const sort = requestData?.sort;
|
|
11083
|
-
|
|
11084
|
-
const menuId = requestData?.menuId;
|
|
11085
|
-
const artifactGroupName = requestData?.artifactGroupName;
|
|
11086
|
-
const artifactGroupId = requestData?.artifactGroupId;
|
|
11087
|
-
const artifactGroupIcon = requestData?.artifactGroupIcon;
|
|
11088
|
-
logger.info("[SDK-NODEJS] Extracted params for create:", JSON.stringify({
|
|
11079
|
+
logger.info("[SDK-NODEJS] Extracted params:", JSON.stringify({
|
|
11089
11080
|
name,
|
|
11090
11081
|
type,
|
|
11091
|
-
|
|
11092
|
-
artifactGroupName,
|
|
11093
|
-
artifactGroupId,
|
|
11094
|
-
artifactGroupIcon
|
|
11082
|
+
filters: filters ? "present" : "undefined"
|
|
11095
11083
|
}, null, 2));
|
|
11084
|
+
logger.info("[SDK-NODEJS] Full requestData.filters:", JSON.stringify(filters, null, 2));
|
|
11096
11085
|
switch (operation) {
|
|
11097
11086
|
case "create":
|
|
11098
|
-
await handleCreate6(id, name, createdBy, dsl,
|
|
11087
|
+
await handleCreate6(id, name, createdBy, dsl, type, filters, status, executeCollection, sendMessage, from.id);
|
|
11099
11088
|
break;
|
|
11100
11089
|
case "update":
|
|
11101
|
-
await handleUpdate6(id, artifactId, name, dsl, status, deleted, executeCollection, sendMessage, from.id);
|
|
11090
|
+
await handleUpdate6(id, artifactId, name, dsl, type, filters, status, deleted, executeCollection, sendMessage, from.id);
|
|
11102
11091
|
break;
|
|
11103
11092
|
case "delete":
|
|
11104
11093
|
await handleDelete6(id, artifactId, executeCollection, sendMessage, from.id);
|
|
@@ -11110,7 +11099,7 @@ async function handleArtifactsRequest(data, collections, sendMessage) {
|
|
|
11110
11099
|
await handleGetOne6(id, artifactId, executeCollection, sendMessage, from.id);
|
|
11111
11100
|
break;
|
|
11112
11101
|
case "query":
|
|
11113
|
-
await handleQuery6(id, { filters, limit, sort }, executeCollection, sendMessage, from.id);
|
|
11102
|
+
await handleQuery6(id, { filters, limit, offset, sort }, executeCollection, sendMessage, from.id);
|
|
11114
11103
|
break;
|
|
11115
11104
|
default:
|
|
11116
11105
|
sendResponse8(id, {
|
|
@@ -11126,7 +11115,7 @@ async function handleArtifactsRequest(data, collections, sendMessage) {
|
|
|
11126
11115
|
}, sendMessage);
|
|
11127
11116
|
}
|
|
11128
11117
|
}
|
|
11129
|
-
async function handleCreate6(id, name, createdBy, dsl,
|
|
11118
|
+
async function handleCreate6(id, name, createdBy, dsl, type, filters, status, executeCollection, sendMessage, clientId) {
|
|
11130
11119
|
if (!name) {
|
|
11131
11120
|
sendResponse8(id, {
|
|
11132
11121
|
success: false,
|
|
@@ -11139,12 +11128,9 @@ async function handleCreate6(id, name, createdBy, dsl, status, type, menuId, art
|
|
|
11139
11128
|
name,
|
|
11140
11129
|
createdBy,
|
|
11141
11130
|
dsl,
|
|
11142
|
-
status,
|
|
11143
11131
|
type,
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
artifactGroupId,
|
|
11147
|
-
artifactGroupIcon
|
|
11132
|
+
filters,
|
|
11133
|
+
status
|
|
11148
11134
|
});
|
|
11149
11135
|
sendResponse8(id, {
|
|
11150
11136
|
success: true,
|
|
@@ -11159,7 +11145,7 @@ async function handleCreate6(id, name, createdBy, dsl, status, type, menuId, art
|
|
|
11159
11145
|
}, sendMessage, clientId);
|
|
11160
11146
|
}
|
|
11161
11147
|
}
|
|
11162
|
-
async function handleUpdate6(id, artifactId, name, dsl, status, deleted, executeCollection, sendMessage, clientId) {
|
|
11148
|
+
async function handleUpdate6(id, artifactId, name, dsl, type, filters, status, deleted, executeCollection, sendMessage, clientId) {
|
|
11163
11149
|
if (!artifactId) {
|
|
11164
11150
|
sendResponse8(id, {
|
|
11165
11151
|
success: false,
|
|
@@ -11168,7 +11154,7 @@ async function handleUpdate6(id, artifactId, name, dsl, status, deleted, execute
|
|
|
11168
11154
|
return;
|
|
11169
11155
|
}
|
|
11170
11156
|
try {
|
|
11171
|
-
const result = await executeCollection("artifacts", "update", { id: artifactId, name, dsl, status, deleted });
|
|
11157
|
+
const result = await executeCollection("artifacts", "update", { id: artifactId, name, dsl, type, filters, status, deleted });
|
|
11172
11158
|
sendResponse8(id, {
|
|
11173
11159
|
success: true,
|
|
11174
11160
|
data: result.data,
|
|
@@ -11247,11 +11233,15 @@ async function handleGetOne6(id, artifactId, executeCollection, sendMessage, cli
|
|
|
11247
11233
|
}
|
|
11248
11234
|
async function handleQuery6(id, queryParams, executeCollection, sendMessage, clientId) {
|
|
11249
11235
|
try {
|
|
11236
|
+
logger.info("[SDK-NODEJS] handleQuery - queryParams:", JSON.stringify(queryParams, null, 2));
|
|
11237
|
+
logger.info("[SDK-NODEJS] handleQuery - filters.type:", queryParams.filters?.type);
|
|
11250
11238
|
const result = await executeCollection("artifacts", "query", {
|
|
11251
11239
|
filters: queryParams.filters,
|
|
11252
11240
|
limit: queryParams.limit || 50,
|
|
11241
|
+
offset: queryParams.offset || 0,
|
|
11253
11242
|
sort: queryParams.sort || "DESC"
|
|
11254
11243
|
});
|
|
11244
|
+
logger.info("[SDK-NODEJS] handleQuery - executeCollection result count:", result.count);
|
|
11255
11245
|
sendResponse8(id, {
|
|
11256
11246
|
success: true,
|
|
11257
11247
|
data: result.data,
|