@meshagent/meshagent 0.40.2 → 0.41.1
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 +13 -0
- package/dist/browser/agent-client.d.ts +2 -8
- package/dist/browser/agent-client.js +2 -14
- package/dist/browser/agent.d.ts +2 -6
- package/dist/browser/agent.js +2 -6
- package/dist/browser/meshagent-client.d.ts +91 -0
- package/dist/browser/meshagent-client.js +111 -5
- package/dist/browser/room-client.d.ts +1 -5
- package/dist/browser/room-client.js +1 -11
- package/dist/browser/storage-client.js +1 -2
- package/dist/esm/agent-client.d.ts +2 -8
- package/dist/esm/agent-client.js +2 -14
- package/dist/esm/agent.d.ts +2 -6
- package/dist/esm/agent.js +2 -6
- package/dist/esm/meshagent-client.d.ts +91 -0
- package/dist/esm/meshagent-client.js +111 -5
- package/dist/esm/room-client.d.ts +1 -5
- package/dist/esm/room-client.js +1 -11
- package/dist/esm/storage-client.js +1 -2
- package/dist/node/agent-client.d.ts +2 -8
- package/dist/node/agent-client.js +2 -14
- package/dist/node/agent.d.ts +2 -6
- package/dist/node/agent.js +2 -6
- package/dist/node/meshagent-client.d.ts +91 -0
- package/dist/node/meshagent-client.js +111 -5
- package/dist/node/room-client.d.ts +1 -5
- package/dist/node/room-client.js +1 -11
- package/dist/node/storage-client.js +1 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## [0.41.1]
|
|
2
|
+
- TypeScript feed subscription requests and responses now carry an optional `filename_datetime_format`.
|
|
3
|
+
- The chatbot UI template now builds and runs as a standalone Next.js app, deploys as a private websocket-enabled service with the `/messages` port, keeps messages pinned to the bottom, and updates Next.js to `16.2.6`.
|
|
4
|
+
|
|
5
|
+
## [0.41.0]
|
|
6
|
+
- Added spec-based route models and route CRUD/listing APIs, including room and agent routes, with legacy-payload compatibility.
|
|
7
|
+
- Managed-agent toolkit descriptions were simplified to omit `thumbnailUrl` and `pricing`.
|
|
8
|
+
- Breaking change: consumers that read the old toolkit metadata fields need to update to the new shape.
|
|
9
|
+
|
|
10
|
+
## [0.40.3]
|
|
11
|
+
- TypeScript client now supports route-spec CRUD/listing for room-backed and agent-backed routes.
|
|
12
|
+
- Toolkit serialization was slimmed down by removing `thumbnailUrl` and `pricing` from toolkit and tool payloads, so consumers must no longer rely on those fields.
|
|
13
|
+
|
|
1
14
|
## [0.40.2]
|
|
2
15
|
- Stability
|
|
3
16
|
|
|
@@ -8,9 +8,7 @@ export declare class ToolDescription {
|
|
|
8
8
|
inputSpec?: ToolContentSpec;
|
|
9
9
|
outputSpec?: ToolContentSpec;
|
|
10
10
|
defs?: Record<string, any>;
|
|
11
|
-
|
|
12
|
-
pricing?: string;
|
|
13
|
-
constructor({ title, name, description, inputSchema, inputSpec, outputSpec, outputSchema, thumbnailUrl, defs, pricing }: {
|
|
11
|
+
constructor({ title, name, description, inputSchema, inputSpec, outputSpec, outputSchema, defs }: {
|
|
14
12
|
title: string;
|
|
15
13
|
name: string;
|
|
16
14
|
description: string;
|
|
@@ -18,9 +16,7 @@ export declare class ToolDescription {
|
|
|
18
16
|
inputSpec?: ToolContentSpec;
|
|
19
17
|
outputSpec?: ToolContentSpec;
|
|
20
18
|
outputSchema?: Record<string, any>;
|
|
21
|
-
thumbnailUrl?: string;
|
|
22
19
|
defs?: Record<string, any>;
|
|
23
|
-
pricing?: string;
|
|
24
20
|
});
|
|
25
21
|
get inputSchema(): Record<string, any> | undefined;
|
|
26
22
|
get outputSchema(): Record<string, any> | undefined;
|
|
@@ -30,15 +26,13 @@ export declare class ToolkitDescription {
|
|
|
30
26
|
readonly name: string;
|
|
31
27
|
readonly description: string;
|
|
32
28
|
readonly tools: ToolDescription[];
|
|
33
|
-
readonly thumbnailUrl?: string;
|
|
34
29
|
readonly participantId?: string;
|
|
35
30
|
private _byName;
|
|
36
|
-
constructor({ title, name, description, tools,
|
|
31
|
+
constructor({ title, name, description, tools, participantId }: {
|
|
37
32
|
title: string;
|
|
38
33
|
name: string;
|
|
39
34
|
description: string;
|
|
40
35
|
tools: ToolDescription[];
|
|
41
|
-
thumbnailUrl?: string;
|
|
42
36
|
participantId?: string;
|
|
43
37
|
});
|
|
44
38
|
getTool(name: string): ToolDescription | undefined;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AgentsClient = exports.ToolkitDescription = exports.ToolDescription = void 0;
|
|
4
4
|
const tool_content_type_1 = require("./tool-content-type");
|
|
5
5
|
class ToolDescription {
|
|
6
|
-
constructor({ title, name, description, inputSchema, inputSpec, outputSpec, outputSchema,
|
|
6
|
+
constructor({ title, name, description, inputSchema, inputSpec, outputSpec, outputSchema, defs }) {
|
|
7
7
|
this.title = title;
|
|
8
8
|
this.name = name;
|
|
9
9
|
this.description = description;
|
|
@@ -41,9 +41,7 @@ class ToolDescription {
|
|
|
41
41
|
schema: outputSchema,
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
this.thumbnailUrl = thumbnailUrl;
|
|
45
44
|
this.defs = defs;
|
|
46
|
-
this.pricing = pricing;
|
|
47
45
|
}
|
|
48
46
|
get inputSchema() {
|
|
49
47
|
return this.inputSpec?.schema;
|
|
@@ -54,12 +52,11 @@ class ToolDescription {
|
|
|
54
52
|
}
|
|
55
53
|
exports.ToolDescription = ToolDescription;
|
|
56
54
|
class ToolkitDescription {
|
|
57
|
-
constructor({ title, name, description, tools,
|
|
55
|
+
constructor({ title, name, description, tools, participantId }) {
|
|
58
56
|
this.title = title;
|
|
59
57
|
this.name = name;
|
|
60
58
|
this.description = description;
|
|
61
59
|
this.tools = tools;
|
|
62
|
-
this.thumbnailUrl = thumbnailUrl;
|
|
63
60
|
this.participantId = participantId;
|
|
64
61
|
this._byName = new Map(this.tools.map((tool) => [tool.name, tool]));
|
|
65
62
|
}
|
|
@@ -71,7 +68,6 @@ class ToolkitDescription {
|
|
|
71
68
|
name: this.name,
|
|
72
69
|
description: this.description,
|
|
73
70
|
title: this.title,
|
|
74
|
-
thumbnail_url: this.thumbnailUrl,
|
|
75
71
|
...(this.participantId !== undefined && {
|
|
76
72
|
participant_id: this.participantId,
|
|
77
73
|
}),
|
|
@@ -81,9 +77,7 @@ class ToolkitDescription {
|
|
|
81
77
|
description: tool.description,
|
|
82
78
|
input_spec: tool.inputSpec?.toJson(),
|
|
83
79
|
output_spec: tool.outputSpec?.toJson(),
|
|
84
|
-
thumbnail_url: tool.thumbnailUrl,
|
|
85
80
|
defs: tool.defs,
|
|
86
|
-
pricing: tool.pricing,
|
|
87
81
|
})),
|
|
88
82
|
};
|
|
89
83
|
}
|
|
@@ -92,7 +86,6 @@ class ToolkitDescription {
|
|
|
92
86
|
const title = json["title"] ?? "";
|
|
93
87
|
const finalName = name ?? json["name"] ?? "";
|
|
94
88
|
const description = json["description"] ?? "";
|
|
95
|
-
const thumbnailUrl = json["thumbnail_url"] ?? undefined;
|
|
96
89
|
const participantId = json["participant_id"] ?? undefined;
|
|
97
90
|
const toolsList = [];
|
|
98
91
|
if (Array.isArray(json["tools"])) {
|
|
@@ -105,9 +98,7 @@ class ToolkitDescription {
|
|
|
105
98
|
inputSpec: tool_content_type_1.ToolContentSpec.fromJson(tool["input_spec"]),
|
|
106
99
|
outputSchema: tool["output_schema"],
|
|
107
100
|
outputSpec: tool_content_type_1.ToolContentSpec.fromJson(tool["output_spec"]),
|
|
108
|
-
thumbnailUrl: tool["thumbnail_url"],
|
|
109
101
|
defs: tool["defs"],
|
|
110
|
-
pricing: tool["pricing"],
|
|
111
102
|
}));
|
|
112
103
|
}
|
|
113
104
|
}
|
|
@@ -123,9 +114,7 @@ class ToolkitDescription {
|
|
|
123
114
|
inputSpec: tool_content_type_1.ToolContentSpec.fromJson(tool["input_spec"]),
|
|
124
115
|
outputSchema: tool["output_schema"],
|
|
125
116
|
outputSpec: tool_content_type_1.ToolContentSpec.fromJson(tool["output_spec"]),
|
|
126
|
-
thumbnailUrl: tool["thumbnail_url"],
|
|
127
117
|
defs: tool["defs"],
|
|
128
|
-
pricing: tool["pricing"],
|
|
129
118
|
}));
|
|
130
119
|
}
|
|
131
120
|
}
|
|
@@ -133,7 +122,6 @@ class ToolkitDescription {
|
|
|
133
122
|
title,
|
|
134
123
|
name: finalName,
|
|
135
124
|
description,
|
|
136
|
-
thumbnailUrl,
|
|
137
125
|
participantId,
|
|
138
126
|
tools: toolsList,
|
|
139
127
|
});
|
package/dist/browser/agent.d.ts
CHANGED
|
@@ -8,8 +8,7 @@ export declare abstract class Tool {
|
|
|
8
8
|
readonly title: string;
|
|
9
9
|
readonly inputSpec?: ToolContentSpec;
|
|
10
10
|
readonly outputSpec?: ToolContentSpec;
|
|
11
|
-
|
|
12
|
-
constructor({ name, description, title, inputSchema, inputSpec, outputSpec, outputSchema, thumbnailUrl }: {
|
|
11
|
+
constructor({ name, description, title, inputSchema, inputSpec, outputSpec, outputSchema }: {
|
|
13
12
|
name: string;
|
|
14
13
|
description: string;
|
|
15
14
|
title: string;
|
|
@@ -17,7 +16,6 @@ export declare abstract class Tool {
|
|
|
17
16
|
inputSpec?: ToolContentSpec;
|
|
18
17
|
outputSpec?: ToolContentSpec;
|
|
19
18
|
outputSchema?: Record<string, any>;
|
|
20
|
-
thumbnailUrl?: string;
|
|
21
19
|
});
|
|
22
20
|
get inputSchema(): Record<string, any> | undefined;
|
|
23
21
|
get outputSchema(): Record<string, any> | undefined;
|
|
@@ -27,14 +25,12 @@ export declare class Toolkit {
|
|
|
27
25
|
readonly name: string;
|
|
28
26
|
readonly title: string;
|
|
29
27
|
readonly description: string;
|
|
30
|
-
readonly thumbnailUrl?: string;
|
|
31
28
|
readonly tools: Tool[];
|
|
32
29
|
readonly rules: string[];
|
|
33
|
-
constructor({ name, title, description,
|
|
30
|
+
constructor({ name, title, description, tools, rules }: {
|
|
34
31
|
name: string;
|
|
35
32
|
title?: string;
|
|
36
33
|
description?: string;
|
|
37
|
-
thumbnailUrl?: string;
|
|
38
34
|
tools: Tool[];
|
|
39
35
|
rules?: string[];
|
|
40
36
|
});
|
package/dist/browser/agent.js
CHANGED
|
@@ -8,7 +8,7 @@ const tool_content_type_1 = require("./tool-content-type");
|
|
|
8
8
|
const utils_1 = require("./utils");
|
|
9
9
|
const room_event_1 = require("./room-event");
|
|
10
10
|
class Tool {
|
|
11
|
-
constructor({ name, description, title, inputSchema, inputSpec, outputSpec, outputSchema
|
|
11
|
+
constructor({ name, description, title, inputSchema, inputSpec, outputSpec, outputSchema }) {
|
|
12
12
|
this.name = name;
|
|
13
13
|
this.description = description;
|
|
14
14
|
this.title = title;
|
|
@@ -46,7 +46,6 @@ class Tool {
|
|
|
46
46
|
schema: outputSchema,
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
this.thumbnailUrl = thumbnailUrl;
|
|
50
49
|
}
|
|
51
50
|
get inputSchema() {
|
|
52
51
|
return this.inputSpec?.schema;
|
|
@@ -57,11 +56,10 @@ class Tool {
|
|
|
57
56
|
}
|
|
58
57
|
exports.Tool = Tool;
|
|
59
58
|
class Toolkit {
|
|
60
|
-
constructor({ name, title = name, description = "",
|
|
59
|
+
constructor({ name, title = name, description = "", tools, rules = [] }) {
|
|
61
60
|
this.name = name;
|
|
62
61
|
this.title = title;
|
|
63
62
|
this.description = description;
|
|
64
|
-
this.thumbnailUrl = thumbnailUrl;
|
|
65
63
|
this.tools = tools;
|
|
66
64
|
this.rules = rules;
|
|
67
65
|
}
|
|
@@ -80,7 +78,6 @@ class Toolkit {
|
|
|
80
78
|
title: tool.title,
|
|
81
79
|
input_spec: tool.inputSpec?.toJson(),
|
|
82
80
|
output_spec: tool.outputSpec?.toJson(),
|
|
83
|
-
thumbnail_url: tool.thumbnailUrl,
|
|
84
81
|
};
|
|
85
82
|
}
|
|
86
83
|
return json;
|
|
@@ -150,7 +147,6 @@ class _RemoteToolkitWrapper {
|
|
|
150
147
|
description: this.toolkit.description,
|
|
151
148
|
tools: this.toolkit.getTools(),
|
|
152
149
|
public: public_,
|
|
153
|
-
thumbnail_url: this.toolkit.thumbnailUrl,
|
|
154
150
|
});
|
|
155
151
|
const json = response.json;
|
|
156
152
|
this._registrationId = json["id"];
|
|
@@ -207,6 +207,38 @@ export interface ServiceSpec {
|
|
|
207
207
|
container?: ContainerSpec | null;
|
|
208
208
|
external?: ExternalServiceSpec | null;
|
|
209
209
|
}
|
|
210
|
+
export interface RouteMetadata {
|
|
211
|
+
name: string;
|
|
212
|
+
annotations?: Record<string, string>;
|
|
213
|
+
}
|
|
214
|
+
export interface RouteBackendTarget {
|
|
215
|
+
name: string;
|
|
216
|
+
}
|
|
217
|
+
export interface RouteBackend {
|
|
218
|
+
room?: RouteBackendTarget | null;
|
|
219
|
+
agent?: RouteBackendTarget | null;
|
|
220
|
+
}
|
|
221
|
+
export interface RoutePathSpec {
|
|
222
|
+
path?: string;
|
|
223
|
+
pathType?: "prefix" | "exact";
|
|
224
|
+
targetPort: string | number;
|
|
225
|
+
}
|
|
226
|
+
export interface RouteSpec {
|
|
227
|
+
version: "v1";
|
|
228
|
+
kind: "Route";
|
|
229
|
+
metadata: RouteMetadata;
|
|
230
|
+
domain: string;
|
|
231
|
+
backend: RouteBackend;
|
|
232
|
+
paths?: RoutePathSpec[];
|
|
233
|
+
}
|
|
234
|
+
export interface Route {
|
|
235
|
+
domain: string;
|
|
236
|
+
spec: RouteSpec;
|
|
237
|
+
}
|
|
238
|
+
export interface RoutesPage {
|
|
239
|
+
routes: Route[];
|
|
240
|
+
total: number;
|
|
241
|
+
}
|
|
210
242
|
export interface Mailbox {
|
|
211
243
|
address: string;
|
|
212
244
|
room: string;
|
|
@@ -240,6 +272,7 @@ export interface FeedSubscription {
|
|
|
240
272
|
room: string;
|
|
241
273
|
roomId?: string | null;
|
|
242
274
|
path: string;
|
|
275
|
+
filenameDatetimeFormat?: string | null;
|
|
243
276
|
createdAt: Date;
|
|
244
277
|
annotations: Record<string, string>;
|
|
245
278
|
}
|
|
@@ -344,6 +377,7 @@ export declare class Meshagent {
|
|
|
344
377
|
private parseRoomShare;
|
|
345
378
|
private parseRoomSession;
|
|
346
379
|
private parseRoom;
|
|
380
|
+
private parseRoute;
|
|
347
381
|
private parseFeed;
|
|
348
382
|
private parseFeedSubscription;
|
|
349
383
|
private parseLLMLogger;
|
|
@@ -541,12 +575,14 @@ export declare class Meshagent {
|
|
|
541
575
|
feedId: string;
|
|
542
576
|
room: string;
|
|
543
577
|
path: string;
|
|
578
|
+
filenameDatetimeFormat?: string | null;
|
|
544
579
|
annotations?: Record<string, string>;
|
|
545
580
|
}): Promise<FeedSubscription>;
|
|
546
581
|
updateFeedSubscription(params: {
|
|
547
582
|
projectId: string;
|
|
548
583
|
feedId: string;
|
|
549
584
|
subscriptionId: string;
|
|
585
|
+
filenameDatetimeFormat?: string | null;
|
|
550
586
|
annotations?: Record<string, string>;
|
|
551
587
|
}): Promise<void>;
|
|
552
588
|
getFeedSubscription(projectId: string, feedId: string, subscriptionId: string): Promise<FeedSubscription>;
|
|
@@ -752,6 +788,61 @@ export declare class Meshagent {
|
|
|
752
788
|
offset?: number;
|
|
753
789
|
orderBy?: string;
|
|
754
790
|
}): Promise<RoomInfo[]>;
|
|
791
|
+
createRoute(params: {
|
|
792
|
+
projectId: string;
|
|
793
|
+
spec: RouteSpec;
|
|
794
|
+
}): Promise<void>;
|
|
795
|
+
updateRoute(params: {
|
|
796
|
+
projectId: string;
|
|
797
|
+
domain: string;
|
|
798
|
+
spec: RouteSpec;
|
|
799
|
+
}): Promise<void>;
|
|
800
|
+
getRoute(params: {
|
|
801
|
+
projectId: string;
|
|
802
|
+
domain: string;
|
|
803
|
+
}): Promise<Route>;
|
|
804
|
+
listRoutesPage(projectId: string, options?: {
|
|
805
|
+
count?: number;
|
|
806
|
+
offset?: number;
|
|
807
|
+
filter?: string;
|
|
808
|
+
}): Promise<RoutesPage>;
|
|
809
|
+
listRoutes(projectId: string, options?: {
|
|
810
|
+
count?: number;
|
|
811
|
+
offset?: number;
|
|
812
|
+
filter?: string;
|
|
813
|
+
}): Promise<Route[]>;
|
|
814
|
+
listRoomRoutesPage(params: {
|
|
815
|
+
projectId: string;
|
|
816
|
+
roomName: string;
|
|
817
|
+
count?: number;
|
|
818
|
+
offset?: number;
|
|
819
|
+
filter?: string;
|
|
820
|
+
}): Promise<RoutesPage>;
|
|
821
|
+
listRoomRoutes(params: {
|
|
822
|
+
projectId: string;
|
|
823
|
+
roomName: string;
|
|
824
|
+
count?: number;
|
|
825
|
+
offset?: number;
|
|
826
|
+
filter?: string;
|
|
827
|
+
}): Promise<Route[]>;
|
|
828
|
+
listAgentRoutesPage(params: {
|
|
829
|
+
projectId: string;
|
|
830
|
+
agentName: string;
|
|
831
|
+
count?: number;
|
|
832
|
+
offset?: number;
|
|
833
|
+
filter?: string;
|
|
834
|
+
}): Promise<RoutesPage>;
|
|
835
|
+
listAgentRoutes(params: {
|
|
836
|
+
projectId: string;
|
|
837
|
+
agentName: string;
|
|
838
|
+
count?: number;
|
|
839
|
+
offset?: number;
|
|
840
|
+
filter?: string;
|
|
841
|
+
}): Promise<Route[]>;
|
|
842
|
+
deleteRoute(params: {
|
|
843
|
+
projectId: string;
|
|
844
|
+
domain: string;
|
|
845
|
+
}): Promise<void>;
|
|
755
846
|
listRoomGrants(projectId: string, options?: {
|
|
756
847
|
limit?: number;
|
|
757
848
|
offset?: number;
|
|
@@ -231,6 +231,28 @@ class Meshagent {
|
|
|
231
231
|
annotations: annotations && typeof annotations === "object" ? annotations : {},
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
|
+
parseRoute(data) {
|
|
235
|
+
if (!data || typeof data !== "object") {
|
|
236
|
+
throw new requirement_1.RoomException("Invalid route payload: expected object");
|
|
237
|
+
}
|
|
238
|
+
if (data.spec && typeof data.spec === "object") {
|
|
239
|
+
return { domain: String(data.domain ?? data.spec.domain), spec: data.spec };
|
|
240
|
+
}
|
|
241
|
+
if (typeof data.domain === "string" && typeof data.room_name === "string") {
|
|
242
|
+
return {
|
|
243
|
+
domain: data.domain,
|
|
244
|
+
spec: {
|
|
245
|
+
version: "v1",
|
|
246
|
+
kind: "Route",
|
|
247
|
+
metadata: { name: data.domain, annotations: data.annotations ?? {} },
|
|
248
|
+
domain: data.domain,
|
|
249
|
+
backend: { room: { name: data.room_name } },
|
|
250
|
+
paths: [{ path: "/", pathType: "prefix", targetPort: data.port }],
|
|
251
|
+
},
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
throw new requirement_1.RoomException("Invalid route payload: missing spec");
|
|
255
|
+
}
|
|
234
256
|
parseFeed(data) {
|
|
235
257
|
if (!data || typeof data !== "object") {
|
|
236
258
|
throw new requirement_1.RoomException("Invalid feed payload");
|
|
@@ -277,11 +299,16 @@ class Meshagent {
|
|
|
277
299
|
if (!data || typeof data !== "object") {
|
|
278
300
|
throw new requirement_1.RoomException("Invalid feed subscription payload");
|
|
279
301
|
}
|
|
280
|
-
const { id, feed_id: feedIdRaw, feedId, project_id: projectIdRaw, projectId, room, room_id: roomIdRaw, roomId, path, created_at: createdAtRaw, createdAt, annotations, } = data;
|
|
302
|
+
const { id, feed_id: feedIdRaw, feedId, project_id: projectIdRaw, projectId, room, room_id: roomIdRaw, roomId, path, filename_datetime_format: filenameDatetimeFormatRaw, filenameDatetimeFormat, created_at: createdAtRaw, createdAt, annotations, } = data;
|
|
281
303
|
const feedIdValue = typeof feedId === "string" ? feedId : feedIdRaw;
|
|
282
304
|
const projectIdValue = typeof projectId === "string" ? projectId : projectIdRaw;
|
|
283
305
|
const createdAtValue = typeof createdAt === "string" ? createdAt : createdAtRaw;
|
|
284
306
|
const roomIdValue = typeof roomId === "string" ? roomId : roomIdRaw;
|
|
307
|
+
const filenameDatetimeFormatValue = typeof filenameDatetimeFormat === "string"
|
|
308
|
+
? filenameDatetimeFormat
|
|
309
|
+
: typeof filenameDatetimeFormatRaw === "string"
|
|
310
|
+
? filenameDatetimeFormatRaw
|
|
311
|
+
: undefined;
|
|
285
312
|
if (typeof id !== "string" ||
|
|
286
313
|
typeof feedIdValue !== "string" ||
|
|
287
314
|
typeof projectIdValue !== "string" ||
|
|
@@ -297,6 +324,7 @@ class Meshagent {
|
|
|
297
324
|
room,
|
|
298
325
|
roomId: typeof roomIdValue === "string" ? roomIdValue : undefined,
|
|
299
326
|
path,
|
|
327
|
+
filenameDatetimeFormat: filenameDatetimeFormatValue,
|
|
300
328
|
createdAt: new Date(createdAtValue),
|
|
301
329
|
annotations: annotations && typeof annotations === "object" ? annotations : {},
|
|
302
330
|
};
|
|
@@ -1140,19 +1168,27 @@ class Meshagent {
|
|
|
1140
1168
|
});
|
|
1141
1169
|
}
|
|
1142
1170
|
async createFeedSubscription(params) {
|
|
1143
|
-
const { projectId, feedId, room, path, annotations = {} } = params;
|
|
1171
|
+
const { projectId, feedId, room, path, filenameDatetimeFormat, annotations = {} } = params;
|
|
1144
1172
|
const data = await this.request(`/accounts/projects/${projectId}/feeds/${feedId}/subscriptions`, {
|
|
1145
1173
|
method: "POST",
|
|
1146
|
-
json: {
|
|
1174
|
+
json: {
|
|
1175
|
+
room,
|
|
1176
|
+
path,
|
|
1177
|
+
...(filenameDatetimeFormat !== undefined ? { filename_datetime_format: filenameDatetimeFormat } : {}),
|
|
1178
|
+
annotations,
|
|
1179
|
+
},
|
|
1147
1180
|
action: "create feed subscription",
|
|
1148
1181
|
});
|
|
1149
1182
|
return this.parseFeedSubscription(data.subscription);
|
|
1150
1183
|
}
|
|
1151
1184
|
async updateFeedSubscription(params) {
|
|
1152
|
-
const { projectId, feedId, subscriptionId, annotations = {} } = params;
|
|
1185
|
+
const { projectId, feedId, subscriptionId, filenameDatetimeFormat, annotations = {} } = params;
|
|
1153
1186
|
await this.request(`/accounts/projects/${projectId}/feeds/${feedId}/subscriptions/${subscriptionId}`, {
|
|
1154
1187
|
method: "PUT",
|
|
1155
|
-
json: {
|
|
1188
|
+
json: {
|
|
1189
|
+
...(filenameDatetimeFormat !== undefined ? { filename_datetime_format: filenameDatetimeFormat } : {}),
|
|
1190
|
+
annotations,
|
|
1191
|
+
},
|
|
1156
1192
|
action: "update feed subscription",
|
|
1157
1193
|
responseType: "void",
|
|
1158
1194
|
});
|
|
@@ -1726,6 +1762,76 @@ class Meshagent {
|
|
|
1726
1762
|
const rooms = Array.isArray(data?.rooms) ? data.rooms : [];
|
|
1727
1763
|
return rooms.map((item) => this.parseRoom(item));
|
|
1728
1764
|
}
|
|
1765
|
+
async createRoute(params) {
|
|
1766
|
+
await this.request(`/accounts/projects/${params.projectId}/routes`, {
|
|
1767
|
+
method: "POST",
|
|
1768
|
+
json: { spec: params.spec },
|
|
1769
|
+
action: "create route",
|
|
1770
|
+
responseType: "void",
|
|
1771
|
+
});
|
|
1772
|
+
}
|
|
1773
|
+
async updateRoute(params) {
|
|
1774
|
+
const domain = this.encodePathComponent(params.domain);
|
|
1775
|
+
await this.request(`/accounts/projects/${params.projectId}/routes/${domain}`, {
|
|
1776
|
+
method: "PUT",
|
|
1777
|
+
json: { spec: params.spec },
|
|
1778
|
+
action: "update route",
|
|
1779
|
+
responseType: "void",
|
|
1780
|
+
});
|
|
1781
|
+
}
|
|
1782
|
+
async getRoute(params) {
|
|
1783
|
+
const domain = this.encodePathComponent(params.domain);
|
|
1784
|
+
const data = await this.request(`/accounts/projects/${params.projectId}/routes/${domain}`, {
|
|
1785
|
+
action: "get route",
|
|
1786
|
+
});
|
|
1787
|
+
return this.parseRoute(data.route);
|
|
1788
|
+
}
|
|
1789
|
+
async listRoutesPage(projectId, options = {}) {
|
|
1790
|
+
const { count = 100, offset = 0, filter } = options;
|
|
1791
|
+
const data = await this.request(`/accounts/projects/${projectId}/routes`, {
|
|
1792
|
+
query: { count, offset, filter },
|
|
1793
|
+
action: "list routes",
|
|
1794
|
+
});
|
|
1795
|
+
const routes = Array.isArray(data.routes) ? data.routes.map((item) => this.parseRoute(item)) : [];
|
|
1796
|
+
return { routes, total: Number(data.total ?? routes.length) };
|
|
1797
|
+
}
|
|
1798
|
+
async listRoutes(projectId, options = {}) {
|
|
1799
|
+
return (await this.listRoutesPage(projectId, options)).routes;
|
|
1800
|
+
}
|
|
1801
|
+
async listRoomRoutesPage(params) {
|
|
1802
|
+
const { projectId, roomName, count = 100, offset = 0, filter } = params;
|
|
1803
|
+
const room = this.encodePathComponent(roomName);
|
|
1804
|
+
const data = await this.request(`/accounts/projects/${projectId}/rooms/${room}/routes`, {
|
|
1805
|
+
query: { count, offset, filter },
|
|
1806
|
+
action: "list room routes",
|
|
1807
|
+
});
|
|
1808
|
+
const routes = Array.isArray(data.routes) ? data.routes.map((item) => this.parseRoute(item)) : [];
|
|
1809
|
+
return { routes, total: Number(data.total ?? routes.length) };
|
|
1810
|
+
}
|
|
1811
|
+
async listRoomRoutes(params) {
|
|
1812
|
+
return (await this.listRoomRoutesPage(params)).routes;
|
|
1813
|
+
}
|
|
1814
|
+
async listAgentRoutesPage(params) {
|
|
1815
|
+
const { projectId, agentName, count = 100, offset = 0, filter } = params;
|
|
1816
|
+
const agent = this.encodePathComponent(agentName);
|
|
1817
|
+
const data = await this.request(`/accounts/projects/${projectId}/agents/${agent}/routes`, {
|
|
1818
|
+
query: { count, offset, filter },
|
|
1819
|
+
action: "list agent routes",
|
|
1820
|
+
});
|
|
1821
|
+
const routes = Array.isArray(data.routes) ? data.routes.map((item) => this.parseRoute(item)) : [];
|
|
1822
|
+
return { routes, total: Number(data.total ?? routes.length) };
|
|
1823
|
+
}
|
|
1824
|
+
async listAgentRoutes(params) {
|
|
1825
|
+
return (await this.listAgentRoutesPage(params)).routes;
|
|
1826
|
+
}
|
|
1827
|
+
async deleteRoute(params) {
|
|
1828
|
+
const domain = this.encodePathComponent(params.domain);
|
|
1829
|
+
await this.request(`/accounts/projects/${params.projectId}/routes/${domain}`, {
|
|
1830
|
+
method: "DELETE",
|
|
1831
|
+
action: "delete route",
|
|
1832
|
+
responseType: "void",
|
|
1833
|
+
});
|
|
1834
|
+
}
|
|
1729
1835
|
async listRoomGrants(projectId, options = {}) {
|
|
1730
1836
|
const { limit = 50, offset = 0, orderBy = "room_name" } = options;
|
|
1731
1837
|
const data = await this.request(`/accounts/projects/${projectId}/room-grants`, {
|
|
@@ -176,13 +176,12 @@ export declare class RoomClient {
|
|
|
176
176
|
label: string;
|
|
177
177
|
expectResponse?: boolean;
|
|
178
178
|
}): number | null;
|
|
179
|
-
invokeNowait({ toolkit, tool, input, participantId, onBehalfOfId,
|
|
179
|
+
invokeNowait({ toolkit, tool, input, participantId, onBehalfOfId, }: {
|
|
180
180
|
toolkit: string;
|
|
181
181
|
tool: string;
|
|
182
182
|
input?: Content;
|
|
183
183
|
participantId?: string;
|
|
184
184
|
onBehalfOfId?: string;
|
|
185
|
-
callerContext?: Record<string, unknown>;
|
|
186
185
|
}): void;
|
|
187
186
|
_sendLocalAttributesNowait(attributes: Record<string, unknown>): void;
|
|
188
187
|
_resendLocalAttributesNowait(): void;
|
|
@@ -204,7 +203,6 @@ export declare class RoomClient {
|
|
|
204
203
|
input?: Record<string, unknown> | Content;
|
|
205
204
|
participantId?: string;
|
|
206
205
|
onBehalfOfId?: string;
|
|
207
|
-
callerContext?: Record<string, unknown>;
|
|
208
206
|
}): Promise<Content>;
|
|
209
207
|
invokeWithStreamInput(params: {
|
|
210
208
|
toolkit: string;
|
|
@@ -212,7 +210,6 @@ export declare class RoomClient {
|
|
|
212
210
|
input: AsyncIterable<Content>;
|
|
213
211
|
participantId?: string;
|
|
214
212
|
onBehalfOfId?: string;
|
|
215
|
-
callerContext?: Record<string, unknown>;
|
|
216
213
|
}): Promise<Content>;
|
|
217
214
|
invokeStream(params: {
|
|
218
215
|
toolkit: string;
|
|
@@ -220,7 +217,6 @@ export declare class RoomClient {
|
|
|
220
217
|
input: AsyncIterable<Content>;
|
|
221
218
|
participantId?: string;
|
|
222
219
|
onBehalfOfId?: string;
|
|
223
|
-
callerContext?: Record<string, unknown>;
|
|
224
220
|
}): Promise<AsyncIterable<Content>>;
|
|
225
221
|
private _sendToolCallRequestChunk;
|
|
226
222
|
private _streamInvokeToolRequestChunks;
|
|
@@ -1108,7 +1108,7 @@ class RoomClient {
|
|
|
1108
1108
|
expectResponse,
|
|
1109
1109
|
});
|
|
1110
1110
|
}
|
|
1111
|
-
invokeNowait({ toolkit, tool, input, participantId, onBehalfOfId,
|
|
1111
|
+
invokeNowait({ toolkit, tool, input, participantId, onBehalfOfId, }) {
|
|
1112
1112
|
const resolvedInput = input ?? new response_1.EmptyContent();
|
|
1113
1113
|
const packedInput = (0, utils_1.unpackMessage)(resolvedInput.pack());
|
|
1114
1114
|
const request = {
|
|
@@ -1116,7 +1116,6 @@ class RoomClient {
|
|
|
1116
1116
|
tool,
|
|
1117
1117
|
participant_id: participantId,
|
|
1118
1118
|
on_behalf_of_id: onBehalfOfId,
|
|
1119
|
-
caller_context: callerContext,
|
|
1120
1119
|
tool_call_id: `${Date.now()}-${Math.random().toString(16).slice(2)}`,
|
|
1121
1120
|
arguments: packedInput[0],
|
|
1122
1121
|
};
|
|
@@ -1228,9 +1227,6 @@ class RoomClient {
|
|
|
1228
1227
|
if (params.onBehalfOfId != null) {
|
|
1229
1228
|
request["on_behalf_of_id"] = params.onBehalfOfId;
|
|
1230
1229
|
}
|
|
1231
|
-
if (params.callerContext != null) {
|
|
1232
|
-
request["caller_context"] = params.callerContext;
|
|
1233
|
-
}
|
|
1234
1230
|
return await this.sendRequest("room.invoke_tool", request, requestData);
|
|
1235
1231
|
}
|
|
1236
1232
|
async invokeWithStreamInput(params) {
|
|
@@ -1247,9 +1243,6 @@ class RoomClient {
|
|
|
1247
1243
|
if (params.onBehalfOfId != null) {
|
|
1248
1244
|
request["on_behalf_of_id"] = params.onBehalfOfId;
|
|
1249
1245
|
}
|
|
1250
|
-
if (params.callerContext != null) {
|
|
1251
|
-
request["caller_context"] = params.callerContext;
|
|
1252
|
-
}
|
|
1253
1246
|
const requestTask = this._streamInvokeToolRequestChunks(toolCallId, params.input);
|
|
1254
1247
|
try {
|
|
1255
1248
|
const response = await this.sendRequest("room.invoke_tool", request);
|
|
@@ -1281,9 +1274,6 @@ class RoomClient {
|
|
|
1281
1274
|
if (params.onBehalfOfId != null) {
|
|
1282
1275
|
request["on_behalf_of_id"] = params.onBehalfOfId;
|
|
1283
1276
|
}
|
|
1284
|
-
if (params.callerContext != null) {
|
|
1285
|
-
request["caller_context"] = params.callerContext;
|
|
1286
|
-
}
|
|
1287
1277
|
const requestTask = this._streamInvokeToolRequestChunks(toolCallId, params.input);
|
|
1288
1278
|
void requestTask.catch((error) => {
|
|
1289
1279
|
const stream = this._toolCallStreams.get(toolCallId);
|
|
@@ -136,12 +136,11 @@ class StorageClient extends event_emitter_1.EventEmitter {
|
|
|
136
136
|
updatedAt: _parseStorageTimestamp(value["updated_at"], operation),
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
|
-
async _invoke(operation, input
|
|
139
|
+
async _invoke(operation, input) {
|
|
140
140
|
return await this.client.invoke({
|
|
141
141
|
toolkit: "storage",
|
|
142
142
|
tool: operation,
|
|
143
143
|
input,
|
|
144
|
-
callerContext,
|
|
145
144
|
});
|
|
146
145
|
}
|
|
147
146
|
async list(path) {
|
|
@@ -8,9 +8,7 @@ export declare class ToolDescription {
|
|
|
8
8
|
inputSpec?: ToolContentSpec;
|
|
9
9
|
outputSpec?: ToolContentSpec;
|
|
10
10
|
defs?: Record<string, any>;
|
|
11
|
-
|
|
12
|
-
pricing?: string;
|
|
13
|
-
constructor({ title, name, description, inputSchema, inputSpec, outputSpec, outputSchema, thumbnailUrl, defs, pricing }: {
|
|
11
|
+
constructor({ title, name, description, inputSchema, inputSpec, outputSpec, outputSchema, defs }: {
|
|
14
12
|
title: string;
|
|
15
13
|
name: string;
|
|
16
14
|
description: string;
|
|
@@ -18,9 +16,7 @@ export declare class ToolDescription {
|
|
|
18
16
|
inputSpec?: ToolContentSpec;
|
|
19
17
|
outputSpec?: ToolContentSpec;
|
|
20
18
|
outputSchema?: Record<string, any>;
|
|
21
|
-
thumbnailUrl?: string;
|
|
22
19
|
defs?: Record<string, any>;
|
|
23
|
-
pricing?: string;
|
|
24
20
|
});
|
|
25
21
|
get inputSchema(): Record<string, any> | undefined;
|
|
26
22
|
get outputSchema(): Record<string, any> | undefined;
|
|
@@ -30,15 +26,13 @@ export declare class ToolkitDescription {
|
|
|
30
26
|
readonly name: string;
|
|
31
27
|
readonly description: string;
|
|
32
28
|
readonly tools: ToolDescription[];
|
|
33
|
-
readonly thumbnailUrl?: string;
|
|
34
29
|
readonly participantId?: string;
|
|
35
30
|
private _byName;
|
|
36
|
-
constructor({ title, name, description, tools,
|
|
31
|
+
constructor({ title, name, description, tools, participantId }: {
|
|
37
32
|
title: string;
|
|
38
33
|
name: string;
|
|
39
34
|
description: string;
|
|
40
35
|
tools: ToolDescription[];
|
|
41
|
-
thumbnailUrl?: string;
|
|
42
36
|
participantId?: string;
|
|
43
37
|
});
|
|
44
38
|
getTool(name: string): ToolDescription | undefined;
|