@meshagent/meshagent 0.41.4 → 0.41.6
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 +10 -0
- package/dist/browser/agent-client.d.ts +10 -0
- package/dist/browser/agent-client.js +36 -1
- package/dist/browser/agent.d.ts +109 -14
- package/dist/browser/agent.js +533 -68
- package/dist/browser/datasets-client.d.ts +70 -0
- package/dist/browser/datasets-client.js +79 -0
- package/dist/browser/entrypoint.d.ts +1464 -1426
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.js +2 -0
- package/dist/browser/oauth-scopes.d.ts +2 -0
- package/dist/browser/oauth-scopes.js +21 -0
- package/dist/browser/participant-token.d.ts +1 -3
- package/dist/browser/participant-token.js +2 -3
- package/dist/browser/room-client.d.ts +16 -0
- package/dist/browser/room-client.js +69 -0
- package/dist/browser/storage-client.d.ts +3 -1
- package/dist/browser/storage-client.js +5 -2
- package/dist/browser/tool-content-type.d.ts +1 -1
- package/dist/browser/tool-content-type.js +3 -2
- package/dist/browser/toolkit-config.d.ts +84 -0
- package/dist/browser/toolkit-config.js +415 -0
- package/dist/esm/agent-client.d.ts +10 -0
- package/dist/esm/agent-client.js +36 -1
- package/dist/esm/agent.d.ts +109 -14
- package/dist/esm/agent.js +533 -68
- package/dist/esm/datasets-client.d.ts +70 -0
- package/dist/esm/datasets-client.js +79 -0
- package/dist/esm/entrypoint.d.ts +1464 -1426
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/oauth-scopes.d.ts +2 -0
- package/dist/esm/oauth-scopes.js +21 -0
- package/dist/esm/participant-token.d.ts +1 -3
- package/dist/esm/participant-token.js +2 -3
- package/dist/esm/room-client.d.ts +16 -0
- package/dist/esm/room-client.js +69 -0
- package/dist/esm/storage-client.d.ts +3 -1
- package/dist/esm/storage-client.js +5 -2
- package/dist/esm/tool-content-type.d.ts +1 -1
- package/dist/esm/tool-content-type.js +3 -2
- package/dist/esm/toolkit-config.d.ts +84 -0
- package/dist/esm/toolkit-config.js +415 -0
- package/dist/node/agent-client.d.ts +10 -0
- package/dist/node/agent-client.js +36 -1
- package/dist/node/agent.d.ts +109 -14
- package/dist/node/agent.js +533 -68
- package/dist/node/datasets-client.d.ts +70 -0
- package/dist/node/datasets-client.js +79 -0
- package/dist/node/entrypoint.d.ts +1464 -1426
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.js +2 -0
- package/dist/node/oauth-scopes.d.ts +2 -0
- package/dist/node/oauth-scopes.js +21 -0
- package/dist/node/participant-token.d.ts +1 -3
- package/dist/node/participant-token.js +2 -3
- package/dist/node/room-client.d.ts +16 -0
- package/dist/node/room-client.js +69 -0
- package/dist/node/storage-client.d.ts +3 -1
- package/dist/node/storage-client.js +5 -2
- package/dist/node/tool-content-type.d.ts +1 -1
- package/dist/node/tool-content-type.js +3 -2
- package/dist/node/toolkit-config.d.ts +84 -0
- package/dist/node/toolkit-config.js +415 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## [0.41.6]
|
|
2
|
+
- Added convenience dataset helpers and toolkit-config support to the TypeScript SDK, expanding room- and dataset-aware workflows.
|
|
3
|
+
- Extended the TypeScript storage client download URL API with an optional `download` flag so callers can request attachment-style links.
|
|
4
|
+
- Updated the TypeScript agent/chat packages to support room shell and room storage toolkits with richer threaded chat behavior.
|
|
5
|
+
- Improved Powerboards meetings with meeting previews, camera-grid handling, and video-chat collapse fixes.
|
|
6
|
+
- Added syntax-highlighted file previews to the React UI, including `react-syntax-highlighter@^16.1.1` and `@types/react-syntax-highlighter@^15.5.13`.
|
|
7
|
+
|
|
8
|
+
## [0.41.5]
|
|
9
|
+
- Stability
|
|
10
|
+
|
|
1
11
|
## [0.41.4]
|
|
2
12
|
- Stability
|
|
3
13
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RoomClient } from "./room-client";
|
|
2
2
|
import type { Content } from "./response";
|
|
3
|
+
import { ToolInput, type ToolCallOutput } from "./agent";
|
|
3
4
|
import { ToolContentSpec } from "./tool-content-type";
|
|
4
5
|
export declare class ToolDescription {
|
|
5
6
|
title: string;
|
|
@@ -56,9 +57,18 @@ export declare class AgentsClient {
|
|
|
56
57
|
participantName?: string;
|
|
57
58
|
timeout?: number;
|
|
58
59
|
}): Promise<ToolkitDescription[]>;
|
|
60
|
+
invokeTool(params: {
|
|
61
|
+
toolkit: string;
|
|
62
|
+
tool: string;
|
|
63
|
+
input: ToolInput;
|
|
64
|
+
participantId?: string;
|
|
65
|
+
onBehalfOfId?: string;
|
|
66
|
+
}): Promise<ToolCallOutput>;
|
|
59
67
|
invokeTool(params: {
|
|
60
68
|
toolkit: string;
|
|
61
69
|
tool: string;
|
|
62
70
|
arguments: Record<string, any>;
|
|
71
|
+
participantId?: string;
|
|
72
|
+
onBehalfOfId?: string;
|
|
63
73
|
}): Promise<Content>;
|
|
64
74
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AgentsClient = exports.ToolkitDescription = exports.ToolDescription = void 0;
|
|
4
|
+
const agent_1 = require("./agent");
|
|
4
5
|
const tool_content_type_1 = require("./tool-content-type");
|
|
5
6
|
class ToolDescription {
|
|
6
7
|
constructor({ title, name, description, inputSchema, inputSpec, outputSpec, outputSchema, defs }) {
|
|
@@ -139,7 +140,41 @@ class AgentsClient {
|
|
|
139
140
|
return await this.client.listToolkits(params);
|
|
140
141
|
}
|
|
141
142
|
async invokeTool(params) {
|
|
142
|
-
|
|
143
|
+
if (params.input === undefined) {
|
|
144
|
+
return await this.client.invoke({
|
|
145
|
+
toolkit: params.toolkit,
|
|
146
|
+
tool: params.tool,
|
|
147
|
+
arguments: params.arguments ?? {},
|
|
148
|
+
participantId: params.participantId,
|
|
149
|
+
onBehalfOfId: params.onBehalfOfId,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
if (params.input instanceof agent_1.ToolContentInput) {
|
|
153
|
+
const output = await this.client.invokeToolCall({
|
|
154
|
+
toolkit: params.toolkit,
|
|
155
|
+
tool: params.tool,
|
|
156
|
+
input: params.input.content,
|
|
157
|
+
participantId: params.participantId,
|
|
158
|
+
onBehalfOfId: params.onBehalfOfId,
|
|
159
|
+
});
|
|
160
|
+
return output.kind === "content"
|
|
161
|
+
? new agent_1.ToolContentOutput(output.content)
|
|
162
|
+
: new agent_1.ToolStreamOutput(output.stream, { inputClosed: output.inputClosed });
|
|
163
|
+
}
|
|
164
|
+
if (params.input instanceof agent_1.ToolStreamInput) {
|
|
165
|
+
const output = await this.client.invokeToolCall({
|
|
166
|
+
toolkit: params.toolkit,
|
|
167
|
+
tool: params.tool,
|
|
168
|
+
input: params.input.stream,
|
|
169
|
+
streamInput: true,
|
|
170
|
+
participantId: params.participantId,
|
|
171
|
+
onBehalfOfId: params.onBehalfOfId,
|
|
172
|
+
});
|
|
173
|
+
return output.kind === "content"
|
|
174
|
+
? new agent_1.ToolContentOutput(output.content)
|
|
175
|
+
: new agent_1.ToolStreamOutput(output.stream, { inputClosed: output.inputClosed });
|
|
176
|
+
}
|
|
177
|
+
throw new Error("invokeTool input must be ToolContentInput or ToolStreamInput");
|
|
143
178
|
}
|
|
144
179
|
}
|
|
145
180
|
exports.AgentsClient = AgentsClient;
|
package/dist/browser/agent.d.ts
CHANGED
|
@@ -1,42 +1,137 @@
|
|
|
1
1
|
import { RoomClient } from "./room-client";
|
|
2
2
|
import { RequiredToolkit } from "./requirement";
|
|
3
3
|
import { type Content } from "./response";
|
|
4
|
+
import { RoomServerException } from "./room-server-client";
|
|
4
5
|
import { ToolContentSpec } from "./tool-content-type";
|
|
5
|
-
|
|
6
|
+
import { Participant } from "./participant";
|
|
7
|
+
export type ValidationMode = "full" | "contentTypes" | "none";
|
|
8
|
+
export declare class InvalidToolDataException extends RoomServerException {
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
|
11
|
+
export declare class ToolContext {
|
|
12
|
+
readonly caller?: Participant;
|
|
13
|
+
readonly onBehalfOf?: Participant;
|
|
14
|
+
constructor({ caller, onBehalfOf }?: {
|
|
15
|
+
caller?: Participant;
|
|
16
|
+
onBehalfOf?: Participant;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export declare class RoomToolContext extends ToolContext {
|
|
20
|
+
readonly room: RoomClient;
|
|
21
|
+
constructor({ room, caller, onBehalfOf }: {
|
|
22
|
+
room: RoomClient;
|
|
23
|
+
caller?: Participant;
|
|
24
|
+
onBehalfOf?: Participant;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export declare abstract class ToolInput {
|
|
28
|
+
}
|
|
29
|
+
export declare class ToolContentInput extends ToolInput {
|
|
30
|
+
readonly content: Content;
|
|
31
|
+
constructor(content: Content);
|
|
32
|
+
}
|
|
33
|
+
export declare class ToolStreamInput extends ToolInput {
|
|
34
|
+
readonly stream: AsyncIterable<Content>;
|
|
35
|
+
constructor(stream: AsyncIterable<Content>);
|
|
36
|
+
}
|
|
37
|
+
export declare abstract class ToolCallOutput {
|
|
38
|
+
}
|
|
39
|
+
export declare class ToolContentOutput extends ToolCallOutput {
|
|
40
|
+
readonly content: Content;
|
|
41
|
+
constructor(content: Content);
|
|
42
|
+
}
|
|
43
|
+
export declare class ToolStreamOutput extends ToolCallOutput {
|
|
44
|
+
readonly stream: AsyncIterable<Content>;
|
|
45
|
+
readonly inputClosed?: Promise<void>;
|
|
46
|
+
constructor(stream: AsyncIterable<Content>, { inputClosed }?: {
|
|
47
|
+
inputClosed?: Promise<void>;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
export declare abstract class BaseTool {
|
|
6
51
|
readonly name: string;
|
|
7
|
-
readonly description
|
|
8
|
-
readonly title
|
|
52
|
+
readonly description?: string;
|
|
53
|
+
readonly title?: string;
|
|
54
|
+
readonly inputSchema?: Record<string, any>;
|
|
9
55
|
readonly inputSpec?: ToolContentSpec;
|
|
10
56
|
readonly outputSpec?: ToolContentSpec;
|
|
11
|
-
|
|
57
|
+
readonly outputSchema?: Record<string, any>;
|
|
58
|
+
readonly defs?: Record<string, any>;
|
|
59
|
+
constructor({ name, description, title, inputSchema, inputSpec, outputSpec, outputSchema, defs }: {
|
|
12
60
|
name: string;
|
|
13
|
-
description
|
|
14
|
-
title
|
|
61
|
+
description?: string;
|
|
62
|
+
title?: string;
|
|
63
|
+
inputSchema?: Record<string, any>;
|
|
64
|
+
inputSpec?: ToolContentSpec;
|
|
65
|
+
outputSpec?: ToolContentSpec;
|
|
66
|
+
outputSchema?: Record<string, any>;
|
|
67
|
+
defs?: Record<string, any>;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
export declare abstract class FunctionTool extends BaseTool {
|
|
71
|
+
abstract execute(context: ToolContext, arguments_: Record<string, any>): Promise<Content>;
|
|
72
|
+
executeStream(context: ToolContext, arguments_: Record<string, any>): AsyncIterable<Content>;
|
|
73
|
+
}
|
|
74
|
+
export declare abstract class ContentTool extends BaseTool {
|
|
75
|
+
abstract execute(context: ToolContext, input: ToolInput): Promise<ToolCallOutput>;
|
|
76
|
+
}
|
|
77
|
+
export declare abstract class Tool extends BaseTool {
|
|
78
|
+
constructor(params: {
|
|
79
|
+
name: string;
|
|
80
|
+
description?: string;
|
|
81
|
+
title?: string;
|
|
15
82
|
inputSchema?: Record<string, any>;
|
|
16
83
|
inputSpec?: ToolContentSpec;
|
|
17
84
|
outputSpec?: ToolContentSpec;
|
|
18
85
|
outputSchema?: Record<string, any>;
|
|
86
|
+
defs?: Record<string, any>;
|
|
19
87
|
});
|
|
20
|
-
get inputSchema(): Record<string, any> | undefined;
|
|
21
|
-
get outputSchema(): Record<string, any> | undefined;
|
|
22
88
|
abstract execute(arguments_: Record<string, any>): Promise<Content>;
|
|
23
89
|
}
|
|
24
90
|
export declare class Toolkit {
|
|
25
91
|
readonly name: string;
|
|
26
|
-
readonly title
|
|
27
|
-
readonly description
|
|
28
|
-
readonly tools:
|
|
92
|
+
readonly title?: string;
|
|
93
|
+
readonly description?: string;
|
|
94
|
+
readonly tools: BaseTool[];
|
|
29
95
|
readonly rules: string[];
|
|
30
|
-
|
|
96
|
+
readonly validationMode: ValidationMode;
|
|
97
|
+
constructor({ name, title, description, tools, rules, validationMode }: {
|
|
31
98
|
name: string;
|
|
32
99
|
title?: string;
|
|
33
100
|
description?: string;
|
|
34
|
-
tools:
|
|
101
|
+
tools: BaseTool[];
|
|
35
102
|
rules?: string[];
|
|
103
|
+
validationMode?: ValidationMode;
|
|
36
104
|
});
|
|
37
|
-
getTool(name: string):
|
|
105
|
+
getTool(name: string): BaseTool;
|
|
38
106
|
getTools(): Record<string, any>;
|
|
39
107
|
execute(name: string, args: Record<string, any>): Promise<Content>;
|
|
108
|
+
execute(context: ToolContext, name: string, input: ToolInput): Promise<ToolCallOutput>;
|
|
109
|
+
private executeTool;
|
|
110
|
+
private decodeFunctionToolArguments;
|
|
111
|
+
private get shouldValidateContentTypes();
|
|
112
|
+
private get shouldValidateSchema();
|
|
113
|
+
resolveInputSpec(tool: BaseTool): ToolContentSpec | undefined;
|
|
114
|
+
resolveOutputSpec(tool: BaseTool): ToolContentSpec | undefined;
|
|
115
|
+
validateStreamMode({ tool, direction, spec, stream }: {
|
|
116
|
+
tool: BaseTool;
|
|
117
|
+
direction: "input" | "output";
|
|
118
|
+
spec?: ToolContentSpec;
|
|
119
|
+
stream: boolean;
|
|
120
|
+
}): void;
|
|
121
|
+
validateContentType({ tool, direction, spec, content }: {
|
|
122
|
+
tool: BaseTool;
|
|
123
|
+
direction: "input" | "output";
|
|
124
|
+
spec?: ToolContentSpec;
|
|
125
|
+
content: Content;
|
|
126
|
+
}): void;
|
|
127
|
+
validateSchema({ tool, direction, content, schema }: {
|
|
128
|
+
tool: BaseTool;
|
|
129
|
+
direction: "input" | "output";
|
|
130
|
+
content: Content;
|
|
131
|
+
schema?: Record<string, any>;
|
|
132
|
+
}): void;
|
|
133
|
+
validateInputContent(tool: BaseTool, content: Content): void;
|
|
134
|
+
validateOutputContent(tool: BaseTool, content: Content): void;
|
|
40
135
|
}
|
|
41
136
|
export declare class HostedToolkit {
|
|
42
137
|
readonly toolkit: Toolkit;
|