@meshagent/meshagent 0.25.8 → 0.26.0
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/CHANGELOG.md +6 -0
- package/dist/browser/agent-client.d.ts +8 -2
- package/dist/browser/agent-client.js +19 -3
- package/dist/browser/requirement.d.ts +3 -1
- package/dist/browser/requirement.js +8 -2
- package/dist/esm/agent-client.d.ts +8 -2
- package/dist/esm/agent-client.js +19 -3
- package/dist/esm/requirement.d.ts +3 -1
- package/dist/esm/requirement.js +8 -2
- package/dist/node/agent-client.d.ts +8 -2
- package/dist/node/agent-client.js +19 -3
- package/dist/node/requirement.d.ts +3 -1
- package/dist/node/requirement.js +8 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -46,13 +46,15 @@ export declare class ToolkitDescription {
|
|
|
46
46
|
readonly description: string;
|
|
47
47
|
readonly tools: ToolDescription[];
|
|
48
48
|
readonly thumbnailUrl?: string;
|
|
49
|
+
readonly participantId?: string;
|
|
49
50
|
private _byName;
|
|
50
|
-
constructor({ title, name, description, tools, thumbnailUrl }: {
|
|
51
|
+
constructor({ title, name, description, tools, thumbnailUrl, participantId }: {
|
|
51
52
|
title: string;
|
|
52
53
|
name: string;
|
|
53
54
|
description: string;
|
|
54
55
|
tools: ToolDescription[];
|
|
55
56
|
thumbnailUrl?: string;
|
|
57
|
+
participantId?: string;
|
|
56
58
|
});
|
|
57
59
|
getTool(name: string): ToolDescription | undefined;
|
|
58
60
|
toJson(): Record<string, any>;
|
|
@@ -76,7 +78,11 @@ export declare class AgentsClient {
|
|
|
76
78
|
url: string;
|
|
77
79
|
arguments: Record<string, any>;
|
|
78
80
|
}): Promise<void>;
|
|
79
|
-
listToolkits(
|
|
81
|
+
listToolkits(params?: {
|
|
82
|
+
participantId?: string;
|
|
83
|
+
participantName?: string;
|
|
84
|
+
timeout?: number;
|
|
85
|
+
}): Promise<ToolkitDescription[]>;
|
|
80
86
|
invokeTool(params: {
|
|
81
87
|
toolkit: string;
|
|
82
88
|
tool: string;
|
|
@@ -53,12 +53,13 @@ class ToolDescription {
|
|
|
53
53
|
}
|
|
54
54
|
exports.ToolDescription = ToolDescription;
|
|
55
55
|
class ToolkitDescription {
|
|
56
|
-
constructor({ title, name, description, tools, thumbnailUrl }) {
|
|
56
|
+
constructor({ title, name, description, tools, thumbnailUrl, participantId }) {
|
|
57
57
|
this.title = title;
|
|
58
58
|
this.name = name;
|
|
59
59
|
this.description = description;
|
|
60
60
|
this.tools = tools;
|
|
61
61
|
this.thumbnailUrl = thumbnailUrl;
|
|
62
|
+
this.participantId = participantId;
|
|
62
63
|
this._byName = new Map(this.tools.map((tool) => [tool.name, tool]));
|
|
63
64
|
}
|
|
64
65
|
getTool(name) {
|
|
@@ -70,6 +71,9 @@ class ToolkitDescription {
|
|
|
70
71
|
description: this.description,
|
|
71
72
|
title: this.title,
|
|
72
73
|
thumbnail_url: this.thumbnailUrl,
|
|
74
|
+
...(this.participantId !== undefined && {
|
|
75
|
+
participant_id: this.participantId,
|
|
76
|
+
}),
|
|
73
77
|
tools: this.tools.map((tool) => ({
|
|
74
78
|
name: tool.name,
|
|
75
79
|
title: tool.title,
|
|
@@ -86,6 +90,7 @@ class ToolkitDescription {
|
|
|
86
90
|
const finalName = name ?? json["name"] ?? "";
|
|
87
91
|
const description = json["description"] ?? "";
|
|
88
92
|
const thumbnailUrl = json["thumbnail_url"] ?? undefined;
|
|
93
|
+
const participantId = json["participant_id"] ?? undefined;
|
|
89
94
|
const toolsList = [];
|
|
90
95
|
if (Array.isArray(json["tools"])) {
|
|
91
96
|
for (const tool of json["tools"]) {
|
|
@@ -122,6 +127,7 @@ class ToolkitDescription {
|
|
|
122
127
|
name: finalName,
|
|
123
128
|
description,
|
|
124
129
|
thumbnailUrl,
|
|
130
|
+
participantId,
|
|
125
131
|
tools: toolsList,
|
|
126
132
|
});
|
|
127
133
|
}
|
|
@@ -158,8 +164,18 @@ class AgentsClient {
|
|
|
158
164
|
async call(params) {
|
|
159
165
|
await this.client.sendRequest("agent.call", params);
|
|
160
166
|
}
|
|
161
|
-
async listToolkits() {
|
|
162
|
-
const
|
|
167
|
+
async listToolkits(params) {
|
|
168
|
+
const request = {};
|
|
169
|
+
if (params?.participantId != null) {
|
|
170
|
+
request["participant_id"] = params.participantId;
|
|
171
|
+
}
|
|
172
|
+
if (params?.participantName != null) {
|
|
173
|
+
request["participant_name"] = params.participantName;
|
|
174
|
+
}
|
|
175
|
+
if (params?.timeout !== undefined) {
|
|
176
|
+
request["timeout"] = params.timeout;
|
|
177
|
+
}
|
|
178
|
+
const result = (await this.client.sendRequest("agent.list_toolkits", request));
|
|
163
179
|
const tools = result.json["tools"];
|
|
164
180
|
const toolkits = [];
|
|
165
181
|
for (const name of Object.keys(tools)) {
|
|
@@ -11,9 +11,11 @@ export declare abstract class Requirement {
|
|
|
11
11
|
}
|
|
12
12
|
export declare class RequiredToolkit extends Requirement {
|
|
13
13
|
readonly tools?: string[];
|
|
14
|
-
|
|
14
|
+
readonly participantName?: string;
|
|
15
|
+
constructor({ name, tools, participantName, }: {
|
|
15
16
|
name: string;
|
|
16
17
|
tools?: string[];
|
|
18
|
+
participantName?: string;
|
|
17
19
|
});
|
|
18
20
|
toJson(): Record<string, any>;
|
|
19
21
|
}
|
|
@@ -14,7 +14,11 @@ class Requirement {
|
|
|
14
14
|
}
|
|
15
15
|
static fromJson(r) {
|
|
16
16
|
if ("toolkit" in r) {
|
|
17
|
-
return new RequiredToolkit({
|
|
17
|
+
return new RequiredToolkit({
|
|
18
|
+
name: r["toolkit"],
|
|
19
|
+
tools: r["tools"],
|
|
20
|
+
participantName: r["participant_name"],
|
|
21
|
+
});
|
|
18
22
|
}
|
|
19
23
|
if ("schema" in r) {
|
|
20
24
|
return new RequiredSchema({ name: r["schema"] });
|
|
@@ -24,14 +28,16 @@ class Requirement {
|
|
|
24
28
|
}
|
|
25
29
|
exports.Requirement = Requirement;
|
|
26
30
|
class RequiredToolkit extends Requirement {
|
|
27
|
-
constructor({ name, tools }) {
|
|
31
|
+
constructor({ name, tools, participantName, }) {
|
|
28
32
|
super({ name });
|
|
29
33
|
this.tools = tools;
|
|
34
|
+
this.participantName = participantName;
|
|
30
35
|
}
|
|
31
36
|
toJson() {
|
|
32
37
|
return {
|
|
33
38
|
toolkit: this.name,
|
|
34
39
|
tools: this.tools,
|
|
40
|
+
participant_name: this.participantName,
|
|
35
41
|
};
|
|
36
42
|
}
|
|
37
43
|
}
|
|
@@ -46,13 +46,15 @@ export declare class ToolkitDescription {
|
|
|
46
46
|
readonly description: string;
|
|
47
47
|
readonly tools: ToolDescription[];
|
|
48
48
|
readonly thumbnailUrl?: string;
|
|
49
|
+
readonly participantId?: string;
|
|
49
50
|
private _byName;
|
|
50
|
-
constructor({ title, name, description, tools, thumbnailUrl }: {
|
|
51
|
+
constructor({ title, name, description, tools, thumbnailUrl, participantId }: {
|
|
51
52
|
title: string;
|
|
52
53
|
name: string;
|
|
53
54
|
description: string;
|
|
54
55
|
tools: ToolDescription[];
|
|
55
56
|
thumbnailUrl?: string;
|
|
57
|
+
participantId?: string;
|
|
56
58
|
});
|
|
57
59
|
getTool(name: string): ToolDescription | undefined;
|
|
58
60
|
toJson(): Record<string, any>;
|
|
@@ -76,7 +78,11 @@ export declare class AgentsClient {
|
|
|
76
78
|
url: string;
|
|
77
79
|
arguments: Record<string, any>;
|
|
78
80
|
}): Promise<void>;
|
|
79
|
-
listToolkits(
|
|
81
|
+
listToolkits(params?: {
|
|
82
|
+
participantId?: string;
|
|
83
|
+
participantName?: string;
|
|
84
|
+
timeout?: number;
|
|
85
|
+
}): Promise<ToolkitDescription[]>;
|
|
80
86
|
invokeTool(params: {
|
|
81
87
|
toolkit: string;
|
|
82
88
|
tool: string;
|
package/dist/esm/agent-client.js
CHANGED
|
@@ -48,12 +48,13 @@ export class ToolDescription {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
export class ToolkitDescription {
|
|
51
|
-
constructor({ title, name, description, tools, thumbnailUrl }) {
|
|
51
|
+
constructor({ title, name, description, tools, thumbnailUrl, participantId }) {
|
|
52
52
|
this.title = title;
|
|
53
53
|
this.name = name;
|
|
54
54
|
this.description = description;
|
|
55
55
|
this.tools = tools;
|
|
56
56
|
this.thumbnailUrl = thumbnailUrl;
|
|
57
|
+
this.participantId = participantId;
|
|
57
58
|
this._byName = new Map(this.tools.map((tool) => [tool.name, tool]));
|
|
58
59
|
}
|
|
59
60
|
getTool(name) {
|
|
@@ -65,6 +66,9 @@ export class ToolkitDescription {
|
|
|
65
66
|
description: this.description,
|
|
66
67
|
title: this.title,
|
|
67
68
|
thumbnail_url: this.thumbnailUrl,
|
|
69
|
+
...(this.participantId !== undefined && {
|
|
70
|
+
participant_id: this.participantId,
|
|
71
|
+
}),
|
|
68
72
|
tools: this.tools.map((tool) => ({
|
|
69
73
|
name: tool.name,
|
|
70
74
|
title: tool.title,
|
|
@@ -81,6 +85,7 @@ export class ToolkitDescription {
|
|
|
81
85
|
const finalName = name ?? json["name"] ?? "";
|
|
82
86
|
const description = json["description"] ?? "";
|
|
83
87
|
const thumbnailUrl = json["thumbnail_url"] ?? undefined;
|
|
88
|
+
const participantId = json["participant_id"] ?? undefined;
|
|
84
89
|
const toolsList = [];
|
|
85
90
|
if (Array.isArray(json["tools"])) {
|
|
86
91
|
for (const tool of json["tools"]) {
|
|
@@ -117,6 +122,7 @@ export class ToolkitDescription {
|
|
|
117
122
|
name: finalName,
|
|
118
123
|
description,
|
|
119
124
|
thumbnailUrl,
|
|
125
|
+
participantId,
|
|
120
126
|
tools: toolsList,
|
|
121
127
|
});
|
|
122
128
|
}
|
|
@@ -151,8 +157,18 @@ export class AgentsClient {
|
|
|
151
157
|
async call(params) {
|
|
152
158
|
await this.client.sendRequest("agent.call", params);
|
|
153
159
|
}
|
|
154
|
-
async listToolkits() {
|
|
155
|
-
const
|
|
160
|
+
async listToolkits(params) {
|
|
161
|
+
const request = {};
|
|
162
|
+
if (params?.participantId != null) {
|
|
163
|
+
request["participant_id"] = params.participantId;
|
|
164
|
+
}
|
|
165
|
+
if (params?.participantName != null) {
|
|
166
|
+
request["participant_name"] = params.participantName;
|
|
167
|
+
}
|
|
168
|
+
if (params?.timeout !== undefined) {
|
|
169
|
+
request["timeout"] = params.timeout;
|
|
170
|
+
}
|
|
171
|
+
const result = (await this.client.sendRequest("agent.list_toolkits", request));
|
|
156
172
|
const tools = result.json["tools"];
|
|
157
173
|
const toolkits = [];
|
|
158
174
|
for (const name of Object.keys(tools)) {
|
|
@@ -11,9 +11,11 @@ export declare abstract class Requirement {
|
|
|
11
11
|
}
|
|
12
12
|
export declare class RequiredToolkit extends Requirement {
|
|
13
13
|
readonly tools?: string[];
|
|
14
|
-
|
|
14
|
+
readonly participantName?: string;
|
|
15
|
+
constructor({ name, tools, participantName, }: {
|
|
15
16
|
name: string;
|
|
16
17
|
tools?: string[];
|
|
18
|
+
participantName?: string;
|
|
17
19
|
});
|
|
18
20
|
toJson(): Record<string, any>;
|
|
19
21
|
}
|
package/dist/esm/requirement.js
CHANGED
|
@@ -10,7 +10,11 @@ export class Requirement {
|
|
|
10
10
|
}
|
|
11
11
|
static fromJson(r) {
|
|
12
12
|
if ("toolkit" in r) {
|
|
13
|
-
return new RequiredToolkit({
|
|
13
|
+
return new RequiredToolkit({
|
|
14
|
+
name: r["toolkit"],
|
|
15
|
+
tools: r["tools"],
|
|
16
|
+
participantName: r["participant_name"],
|
|
17
|
+
});
|
|
14
18
|
}
|
|
15
19
|
if ("schema" in r) {
|
|
16
20
|
return new RequiredSchema({ name: r["schema"] });
|
|
@@ -19,14 +23,16 @@ export class Requirement {
|
|
|
19
23
|
}
|
|
20
24
|
}
|
|
21
25
|
export class RequiredToolkit extends Requirement {
|
|
22
|
-
constructor({ name, tools }) {
|
|
26
|
+
constructor({ name, tools, participantName, }) {
|
|
23
27
|
super({ name });
|
|
24
28
|
this.tools = tools;
|
|
29
|
+
this.participantName = participantName;
|
|
25
30
|
}
|
|
26
31
|
toJson() {
|
|
27
32
|
return {
|
|
28
33
|
toolkit: this.name,
|
|
29
34
|
tools: this.tools,
|
|
35
|
+
participant_name: this.participantName,
|
|
30
36
|
};
|
|
31
37
|
}
|
|
32
38
|
}
|
|
@@ -46,13 +46,15 @@ export declare class ToolkitDescription {
|
|
|
46
46
|
readonly description: string;
|
|
47
47
|
readonly tools: ToolDescription[];
|
|
48
48
|
readonly thumbnailUrl?: string;
|
|
49
|
+
readonly participantId?: string;
|
|
49
50
|
private _byName;
|
|
50
|
-
constructor({ title, name, description, tools, thumbnailUrl }: {
|
|
51
|
+
constructor({ title, name, description, tools, thumbnailUrl, participantId }: {
|
|
51
52
|
title: string;
|
|
52
53
|
name: string;
|
|
53
54
|
description: string;
|
|
54
55
|
tools: ToolDescription[];
|
|
55
56
|
thumbnailUrl?: string;
|
|
57
|
+
participantId?: string;
|
|
56
58
|
});
|
|
57
59
|
getTool(name: string): ToolDescription | undefined;
|
|
58
60
|
toJson(): Record<string, any>;
|
|
@@ -76,7 +78,11 @@ export declare class AgentsClient {
|
|
|
76
78
|
url: string;
|
|
77
79
|
arguments: Record<string, any>;
|
|
78
80
|
}): Promise<void>;
|
|
79
|
-
listToolkits(
|
|
81
|
+
listToolkits(params?: {
|
|
82
|
+
participantId?: string;
|
|
83
|
+
participantName?: string;
|
|
84
|
+
timeout?: number;
|
|
85
|
+
}): Promise<ToolkitDescription[]>;
|
|
80
86
|
invokeTool(params: {
|
|
81
87
|
toolkit: string;
|
|
82
88
|
tool: string;
|
|
@@ -53,12 +53,13 @@ class ToolDescription {
|
|
|
53
53
|
}
|
|
54
54
|
exports.ToolDescription = ToolDescription;
|
|
55
55
|
class ToolkitDescription {
|
|
56
|
-
constructor({ title, name, description, tools, thumbnailUrl }) {
|
|
56
|
+
constructor({ title, name, description, tools, thumbnailUrl, participantId }) {
|
|
57
57
|
this.title = title;
|
|
58
58
|
this.name = name;
|
|
59
59
|
this.description = description;
|
|
60
60
|
this.tools = tools;
|
|
61
61
|
this.thumbnailUrl = thumbnailUrl;
|
|
62
|
+
this.participantId = participantId;
|
|
62
63
|
this._byName = new Map(this.tools.map((tool) => [tool.name, tool]));
|
|
63
64
|
}
|
|
64
65
|
getTool(name) {
|
|
@@ -70,6 +71,9 @@ class ToolkitDescription {
|
|
|
70
71
|
description: this.description,
|
|
71
72
|
title: this.title,
|
|
72
73
|
thumbnail_url: this.thumbnailUrl,
|
|
74
|
+
...(this.participantId !== undefined && {
|
|
75
|
+
participant_id: this.participantId,
|
|
76
|
+
}),
|
|
73
77
|
tools: this.tools.map((tool) => ({
|
|
74
78
|
name: tool.name,
|
|
75
79
|
title: tool.title,
|
|
@@ -86,6 +90,7 @@ class ToolkitDescription {
|
|
|
86
90
|
const finalName = name ?? json["name"] ?? "";
|
|
87
91
|
const description = json["description"] ?? "";
|
|
88
92
|
const thumbnailUrl = json["thumbnail_url"] ?? undefined;
|
|
93
|
+
const participantId = json["participant_id"] ?? undefined;
|
|
89
94
|
const toolsList = [];
|
|
90
95
|
if (Array.isArray(json["tools"])) {
|
|
91
96
|
for (const tool of json["tools"]) {
|
|
@@ -122,6 +127,7 @@ class ToolkitDescription {
|
|
|
122
127
|
name: finalName,
|
|
123
128
|
description,
|
|
124
129
|
thumbnailUrl,
|
|
130
|
+
participantId,
|
|
125
131
|
tools: toolsList,
|
|
126
132
|
});
|
|
127
133
|
}
|
|
@@ -158,8 +164,18 @@ class AgentsClient {
|
|
|
158
164
|
async call(params) {
|
|
159
165
|
await this.client.sendRequest("agent.call", params);
|
|
160
166
|
}
|
|
161
|
-
async listToolkits() {
|
|
162
|
-
const
|
|
167
|
+
async listToolkits(params) {
|
|
168
|
+
const request = {};
|
|
169
|
+
if (params?.participantId != null) {
|
|
170
|
+
request["participant_id"] = params.participantId;
|
|
171
|
+
}
|
|
172
|
+
if (params?.participantName != null) {
|
|
173
|
+
request["participant_name"] = params.participantName;
|
|
174
|
+
}
|
|
175
|
+
if (params?.timeout !== undefined) {
|
|
176
|
+
request["timeout"] = params.timeout;
|
|
177
|
+
}
|
|
178
|
+
const result = (await this.client.sendRequest("agent.list_toolkits", request));
|
|
163
179
|
const tools = result.json["tools"];
|
|
164
180
|
const toolkits = [];
|
|
165
181
|
for (const name of Object.keys(tools)) {
|
|
@@ -11,9 +11,11 @@ export declare abstract class Requirement {
|
|
|
11
11
|
}
|
|
12
12
|
export declare class RequiredToolkit extends Requirement {
|
|
13
13
|
readonly tools?: string[];
|
|
14
|
-
|
|
14
|
+
readonly participantName?: string;
|
|
15
|
+
constructor({ name, tools, participantName, }: {
|
|
15
16
|
name: string;
|
|
16
17
|
tools?: string[];
|
|
18
|
+
participantName?: string;
|
|
17
19
|
});
|
|
18
20
|
toJson(): Record<string, any>;
|
|
19
21
|
}
|
package/dist/node/requirement.js
CHANGED
|
@@ -14,7 +14,11 @@ class Requirement {
|
|
|
14
14
|
}
|
|
15
15
|
static fromJson(r) {
|
|
16
16
|
if ("toolkit" in r) {
|
|
17
|
-
return new RequiredToolkit({
|
|
17
|
+
return new RequiredToolkit({
|
|
18
|
+
name: r["toolkit"],
|
|
19
|
+
tools: r["tools"],
|
|
20
|
+
participantName: r["participant_name"],
|
|
21
|
+
});
|
|
18
22
|
}
|
|
19
23
|
if ("schema" in r) {
|
|
20
24
|
return new RequiredSchema({ name: r["schema"] });
|
|
@@ -24,14 +28,16 @@ class Requirement {
|
|
|
24
28
|
}
|
|
25
29
|
exports.Requirement = Requirement;
|
|
26
30
|
class RequiredToolkit extends Requirement {
|
|
27
|
-
constructor({ name, tools }) {
|
|
31
|
+
constructor({ name, tools, participantName, }) {
|
|
28
32
|
super({ name });
|
|
29
33
|
this.tools = tools;
|
|
34
|
+
this.participantName = participantName;
|
|
30
35
|
}
|
|
31
36
|
toJson() {
|
|
32
37
|
return {
|
|
33
38
|
toolkit: this.name,
|
|
34
39
|
tools: this.tools,
|
|
40
|
+
participant_name: this.participantName,
|
|
35
41
|
};
|
|
36
42
|
}
|
|
37
43
|
}
|