rentabots-sdk 1.7.41 → 1.7.42
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.ts +6 -9
- package/dist/index.js +7 -7
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -33,15 +33,12 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
33
33
|
jobId: z.ZodString;
|
|
34
34
|
content: z.ZodString;
|
|
35
35
|
senderId: z.ZodString;
|
|
36
|
-
createdAt: z.ZodString
|
|
37
|
-
sender: z.ZodObject<{
|
|
38
|
-
id: z.ZodString
|
|
39
|
-
displayName: z.ZodString
|
|
40
|
-
type: z.
|
|
41
|
-
|
|
42
|
-
agent: "agent";
|
|
43
|
-
}>;
|
|
44
|
-
}, z.core.$strip>;
|
|
36
|
+
createdAt: z.ZodUnion<readonly [z.ZodString, z.ZodDate]>;
|
|
37
|
+
sender: z.ZodOptional<z.ZodObject<{
|
|
38
|
+
id: z.ZodOptional<z.ZodString>;
|
|
39
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
40
|
+
type: z.ZodOptional<z.ZodString>;
|
|
41
|
+
}, z.core.$strip>>;
|
|
45
42
|
}, z.core.$strip>;
|
|
46
43
|
export type Message = z.infer<typeof MessageSchema>;
|
|
47
44
|
export interface AgentOptions {
|
package/dist/index.js
CHANGED
|
@@ -63,15 +63,15 @@ exports.MessageSchema = zod_1.z.object({
|
|
|
63
63
|
jobId: zod_1.z.string(),
|
|
64
64
|
content: zod_1.z.string(),
|
|
65
65
|
senderId: zod_1.z.string(),
|
|
66
|
-
createdAt: zod_1.z.string(),
|
|
66
|
+
createdAt: zod_1.z.union([zod_1.z.string(), zod_1.z.date()]),
|
|
67
67
|
sender: zod_1.z.object({
|
|
68
|
-
id: zod_1.z.string(),
|
|
69
|
-
displayName: zod_1.z.string(),
|
|
70
|
-
type: zod_1.z.
|
|
71
|
-
})
|
|
68
|
+
id: zod_1.z.string().optional(),
|
|
69
|
+
displayName: zod_1.z.string().optional(),
|
|
70
|
+
type: zod_1.z.string().optional()
|
|
71
|
+
}).optional()
|
|
72
72
|
});
|
|
73
73
|
// --- CORE SDK ENGINE ---
|
|
74
|
-
let SDK_VERSION = '1.7.
|
|
74
|
+
let SDK_VERSION = '1.7.42'; // fallback when package.json is unavailable
|
|
75
75
|
try {
|
|
76
76
|
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
|
|
77
77
|
SDK_VERSION = pkg.version;
|
|
@@ -268,7 +268,7 @@ class Agent extends events_1.EventEmitter {
|
|
|
268
268
|
}
|
|
269
269
|
handleIncomingMessage(msg) {
|
|
270
270
|
this.logInternal(`Telemetric event dispatched: ${msg.content.slice(0, 20)}...`);
|
|
271
|
-
if (msg.sender
|
|
271
|
+
if (msg.sender?.type === 'human') {
|
|
272
272
|
const cmd = msg.content.trim();
|
|
273
273
|
if (cmd === '/status')
|
|
274
274
|
return this.handleStatusRequest(msg.jobId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rentabots-sdk",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.42",
|
|
4
4
|
"description": "Official SDK for RentaBots AI Agent Marketplace",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -40,4 +40,4 @@
|
|
|
40
40
|
},
|
|
41
41
|
"author": "",
|
|
42
42
|
"license": "ISC"
|
|
43
|
-
}
|
|
43
|
+
}
|