@knocklabs/agent-toolkit 0.1.3 → 0.1.4
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/ai-sdk/index.d.ts +1 -4
- package/dist/ai-sdk/index.js +14 -20
- package/dist/ai-sdk/index.js.map +1 -1
- package/dist/{chunk-XUYE3AGB.js → chunk-B6DIDKFY.js} +14 -2
- package/dist/chunk-B6DIDKFY.js.map +1 -0
- package/dist/chunk-RPKDXX4O.js +1023 -0
- package/dist/chunk-RPKDXX4O.js.map +1 -0
- package/dist/{chunk-4VR65G5W.js → chunk-ZV2SOIO7.js} +29 -4
- package/dist/chunk-ZV2SOIO7.js.map +1 -0
- package/dist/modelcontextprotocol/index.d.ts +47 -6
- package/dist/modelcontextprotocol/index.js +2 -15
- package/dist/modelcontextprotocol/local-server.js +5 -20
- package/dist/modelcontextprotocol/local-server.js.map +1 -1
- package/dist/openai/index.d.ts +1 -4
- package/dist/openai/index.js +18 -20
- package/dist/openai/index.js.map +1 -1
- package/dist/types-DyB12-Gk.d.ts +73 -0
- package/package.json +2 -2
- package/dist/ai-sdk/tool-converter.d.ts +0 -12
- package/dist/ai-sdk/tool-converter.js +0 -7
- package/dist/ai-sdk/tool-converter.js.map +0 -1
- package/dist/chunk-2CNJ4XX6.js +0 -33
- package/dist/chunk-2CNJ4XX6.js.map +0 -1
- package/dist/chunk-3LZK6RH6.js +0 -29
- package/dist/chunk-3LZK6RH6.js.map +0 -1
- package/dist/chunk-4VR65G5W.js.map +0 -1
- package/dist/chunk-6H3BXH2Y.js +0 -15
- package/dist/chunk-6H3BXH2Y.js.map +0 -1
- package/dist/chunk-BY4KQPUO.js +0 -39
- package/dist/chunk-BY4KQPUO.js.map +0 -1
- package/dist/chunk-DSRTYV37.js +0 -39
- package/dist/chunk-DSRTYV37.js.map +0 -1
- package/dist/chunk-JTYQTWCX.js +0 -75
- package/dist/chunk-JTYQTWCX.js.map +0 -1
- package/dist/chunk-NZB2TMJW.js +0 -92
- package/dist/chunk-NZB2TMJW.js.map +0 -1
- package/dist/chunk-O6DWF42E.js +0 -31
- package/dist/chunk-O6DWF42E.js.map +0 -1
- package/dist/chunk-OD5VHBGN.js +0 -32
- package/dist/chunk-OD5VHBGN.js.map +0 -1
- package/dist/chunk-PDMA6RIB.js +0 -19
- package/dist/chunk-PDMA6RIB.js.map +0 -1
- package/dist/chunk-RYMJEH6P.js +0 -140
- package/dist/chunk-RYMJEH6P.js.map +0 -1
- package/dist/chunk-THLK376Y.js +0 -191
- package/dist/chunk-THLK376Y.js.map +0 -1
- package/dist/chunk-TLHETJRF.js +0 -75
- package/dist/chunk-TLHETJRF.js.map +0 -1
- package/dist/chunk-TOBLV65T.js +0 -30
- package/dist/chunk-TOBLV65T.js.map +0 -1
- package/dist/chunk-VJFA3ZVW.js +0 -210
- package/dist/chunk-VJFA3ZVW.js.map +0 -1
- package/dist/chunk-WB4XCCUS.js +0 -19
- package/dist/chunk-WB4XCCUS.js.map +0 -1
- package/dist/chunk-XRQWR3LY.js +0 -184
- package/dist/chunk-XRQWR3LY.js.map +0 -1
- package/dist/chunk-XUYE3AGB.js.map +0 -1
- package/dist/lib/knock-client.d.ts +0 -4
- package/dist/lib/knock-client.js +0 -7
- package/dist/lib/knock-client.js.map +0 -1
- package/dist/lib/knock-tool.d.ts +0 -4
- package/dist/lib/knock-tool.js +0 -7
- package/dist/lib/knock-tool.js.map +0 -1
- package/dist/lib/tools/channels.d.ts +0 -13
- package/dist/lib/tools/channels.js +0 -10
- package/dist/lib/tools/channels.js.map +0 -1
- package/dist/lib/tools/commits.d.ts +0 -16
- package/dist/lib/tools/commits.js +0 -10
- package/dist/lib/tools/commits.js.map +0 -1
- package/dist/lib/tools/email-layouts.d.ts +0 -13
- package/dist/lib/tools/email-layouts.js +0 -10
- package/dist/lib/tools/email-layouts.js.map +0 -1
- package/dist/lib/tools/environments.d.ts +0 -13
- package/dist/lib/tools/environments.js +0 -10
- package/dist/lib/tools/environments.js.map +0 -1
- package/dist/lib/tools/index.d.ts +0 -4
- package/dist/lib/tools/index.js +0 -23
- package/dist/lib/tools/index.js.map +0 -1
- package/dist/lib/tools/message-types.d.ts +0 -15
- package/dist/lib/tools/message-types.js +0 -10
- package/dist/lib/tools/message-types.js.map +0 -1
- package/dist/lib/tools/messages.d.ts +0 -13
- package/dist/lib/tools/messages.js +0 -10
- package/dist/lib/tools/messages.js.map +0 -1
- package/dist/lib/tools/objects.d.ts +0 -19
- package/dist/lib/tools/objects.js +0 -10
- package/dist/lib/tools/objects.js.map +0 -1
- package/dist/lib/tools/partials.d.ts +0 -13
- package/dist/lib/tools/partials.js +0 -10
- package/dist/lib/tools/partials.js.map +0 -1
- package/dist/lib/tools/tenants.d.ts +0 -16
- package/dist/lib/tools/tenants.js +0 -10
- package/dist/lib/tools/tenants.js.map +0 -1
- package/dist/lib/tools/users.d.ts +0 -19
- package/dist/lib/tools/users.js +0 -10
- package/dist/lib/tools/users.js.map +0 -1
- package/dist/lib/tools/workflows.d.ts +0 -18
- package/dist/lib/tools/workflows.js +0 -10
- package/dist/lib/tools/workflows.js.map +0 -1
- package/dist/lib/utils.d.ts +0 -33
- package/dist/lib/utils.js +0 -24
- package/dist/lib/utils.js.map +0 -1
- package/dist/modelcontextprotocol/adapter.d.ts +0 -11
- package/dist/modelcontextprotocol/adapter.js +0 -7
- package/dist/modelcontextprotocol/adapter.js.map +0 -1
- package/dist/openai/tool-converter.d.ts +0 -15
- package/dist/openai/tool-converter.js +0 -7
- package/dist/openai/tool-converter.js.map +0 -1
- package/dist/types-B-9pppCQ.d.ts +0 -199
- package/dist/types.d.ts +0 -4
- package/dist/types.js +0 -1
- package/dist/types.js.map +0 -1
package/dist/lib/utils.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { a as KnockTool, t as toolPermissions, T as ToolkitConfig, b as ToolCategory } from '../types-B-9pppCQ.js';
|
|
2
|
-
import 'zod';
|
|
3
|
-
import '@knocklabs/node';
|
|
4
|
-
import '@knocklabs/mgmt';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Given a list of tools, and some config may describe the tools that should be provided to the LLM,
|
|
8
|
-
* returns a filtered list of tools that match the config.
|
|
9
|
-
*
|
|
10
|
-
* Options:
|
|
11
|
-
* `*` - All tools
|
|
12
|
-
* `users.*` - All tools that start with `users.`
|
|
13
|
-
* `users.getUser` - A specific tool
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
declare function filterTools(tools: Record<string, Record<string, KnockTool>>, pattern: string | undefined): KnockTool[];
|
|
17
|
-
/**
|
|
18
|
-
* Given a category and a list of permissions, return a list of tools that the user has permission to use.
|
|
19
|
-
*
|
|
20
|
-
* @param category - The category to get tools for
|
|
21
|
-
* @param categoryPermissions - The permissions to use
|
|
22
|
-
* @returns A list of tools that the user has permission to use
|
|
23
|
-
*/
|
|
24
|
-
declare function getToolsWithPermissions(category: keyof typeof toolPermissions, categoryPermissions: Record<string, boolean | undefined>): KnockTool[];
|
|
25
|
-
/**
|
|
26
|
-
* Given a config, return a list of tools for each category that the user has permission to use.
|
|
27
|
-
*
|
|
28
|
-
* @param config - The config to use
|
|
29
|
-
* @returns A list of tools for each category that the user has permission to use
|
|
30
|
-
*/
|
|
31
|
-
declare function getToolsByPermissionsInCategories(config: ToolkitConfig): Record<ToolCategory, KnockTool[]>;
|
|
32
|
-
|
|
33
|
-
export { filterTools, getToolsByPermissionsInCategories, getToolsWithPermissions };
|
package/dist/lib/utils.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
filterTools,
|
|
3
|
-
getToolsByPermissionsInCategories,
|
|
4
|
-
getToolsWithPermissions
|
|
5
|
-
} from "../chunk-4VR65G5W.js";
|
|
6
|
-
import "../chunk-NZB2TMJW.js";
|
|
7
|
-
import "../chunk-THLK376Y.js";
|
|
8
|
-
import "../chunk-OD5VHBGN.js";
|
|
9
|
-
import "../chunk-RYMJEH6P.js";
|
|
10
|
-
import "../chunk-BY4KQPUO.js";
|
|
11
|
-
import "../chunk-JTYQTWCX.js";
|
|
12
|
-
import "../chunk-VJFA3ZVW.js";
|
|
13
|
-
import "../chunk-XRQWR3LY.js";
|
|
14
|
-
import "../chunk-2CNJ4XX6.js";
|
|
15
|
-
import "../chunk-TLHETJRF.js";
|
|
16
|
-
import "../chunk-DSRTYV37.js";
|
|
17
|
-
import "../chunk-O6DWF42E.js";
|
|
18
|
-
import "../chunk-TOBLV65T.js";
|
|
19
|
-
export {
|
|
20
|
-
filterTools,
|
|
21
|
-
getToolsByPermissionsInCategories,
|
|
22
|
-
getToolsWithPermissions
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=utils.js.map
|
package/dist/lib/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { K as KnockClient, C as Config, a as KnockTool } from '../types-B-9pppCQ.js';
|
|
3
|
-
import 'zod';
|
|
4
|
-
import '@knocklabs/node';
|
|
5
|
-
import '@knocklabs/mgmt';
|
|
6
|
-
|
|
7
|
-
declare class KnockMcpServer extends McpServer {
|
|
8
|
-
constructor(knockClient: KnockClient, config: Config, tools: KnockTool[]);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { KnockMcpServer };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { a as KnockTool } from '../types-B-9pppCQ.js';
|
|
2
|
-
import { ChatCompletionTool } from 'openai/resources.mjs';
|
|
3
|
-
import 'zod';
|
|
4
|
-
import '@knocklabs/node';
|
|
5
|
-
import '@knocklabs/mgmt';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Convert a KnockTool to a ChatCompletionTool, ready to be used with the OpenAI API.
|
|
9
|
-
*
|
|
10
|
-
* @param knockTool - The KnockTool to convert
|
|
11
|
-
* @returns The converted ChatCompletionTool
|
|
12
|
-
*/
|
|
13
|
-
declare function knockToolToChatCompletionTool(knockTool: KnockTool): ChatCompletionTool;
|
|
14
|
-
|
|
15
|
-
export { knockToolToChatCompletionTool };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/types-B-9pppCQ.d.ts
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { ZodObject } from 'zod';
|
|
2
|
-
import { Knock } from '@knocklabs/node';
|
|
3
|
-
import KnockMgmt from '@knocklabs/mgmt';
|
|
4
|
-
|
|
5
|
-
type KnockClient = ReturnType<typeof createKnockClient>;
|
|
6
|
-
declare const createKnockClient: (config: Config) => KnockMgmt & {
|
|
7
|
-
publicApi: (_environment?: string) => Promise<Knock>;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
interface KnockToolDefinition {
|
|
11
|
-
/**
|
|
12
|
-
* The method name of the tool. This is a machine-readable string.
|
|
13
|
-
*/
|
|
14
|
-
method: string;
|
|
15
|
-
/**
|
|
16
|
-
* The name of the tool. This can be used to reference the tool in the code.
|
|
17
|
-
* A descriptive LLM-readable string.
|
|
18
|
-
*/
|
|
19
|
-
name: string;
|
|
20
|
-
/**
|
|
21
|
-
* A descriptive prompt explaining the tool's purpose, including examples where useful.
|
|
22
|
-
*/
|
|
23
|
-
description: string;
|
|
24
|
-
/**
|
|
25
|
-
* A descriptive prompt explaining the tool's purpose, usage and input parameters.
|
|
26
|
-
* Ths is intended to be used by the underlying LLM.
|
|
27
|
-
*/
|
|
28
|
-
fullDescription: string;
|
|
29
|
-
/**
|
|
30
|
-
* The Zod schema for the input parameters of the tool
|
|
31
|
-
*/
|
|
32
|
-
parameters?: ZodObject<any>;
|
|
33
|
-
/**
|
|
34
|
-
* The actual implementation of the tool.
|
|
35
|
-
*/
|
|
36
|
-
execute: (knockClient: KnockClient, config: Config) => (input: any) => Promise<unknown>;
|
|
37
|
-
}
|
|
38
|
-
interface KnockTool extends Omit<KnockToolDefinition, "execute"> {
|
|
39
|
-
bindExecute: (knockClient: KnockClient, config: Config) => (input: any) => Promise<unknown>;
|
|
40
|
-
}
|
|
41
|
-
declare const KnockTool: (args: Omit<KnockToolDefinition, "fullDescription">) => KnockTool;
|
|
42
|
-
|
|
43
|
-
declare const tools: {
|
|
44
|
-
channels: {
|
|
45
|
-
listChannels: KnockTool;
|
|
46
|
-
};
|
|
47
|
-
commits: {
|
|
48
|
-
listCommits: KnockTool;
|
|
49
|
-
commitAllChanges: KnockTool;
|
|
50
|
-
promoteAllCommits: KnockTool;
|
|
51
|
-
};
|
|
52
|
-
emailLayouts: {
|
|
53
|
-
listEmailLayouts: KnockTool;
|
|
54
|
-
};
|
|
55
|
-
environments: {
|
|
56
|
-
listEnvironments: KnockTool;
|
|
57
|
-
};
|
|
58
|
-
messages: {
|
|
59
|
-
getMessageContent: KnockTool;
|
|
60
|
-
};
|
|
61
|
-
messageTypes: {
|
|
62
|
-
listMessageTypes: KnockTool;
|
|
63
|
-
createOrUpdateMessageType: KnockTool;
|
|
64
|
-
};
|
|
65
|
-
objects: {
|
|
66
|
-
listObjects: KnockTool;
|
|
67
|
-
getObject: KnockTool;
|
|
68
|
-
createOrUpdateObject: KnockTool;
|
|
69
|
-
deleteObject: KnockTool;
|
|
70
|
-
subscribeUsersToObject: KnockTool;
|
|
71
|
-
unsubscribeUsersFromObject: KnockTool;
|
|
72
|
-
};
|
|
73
|
-
partials: {
|
|
74
|
-
listPartials: KnockTool;
|
|
75
|
-
};
|
|
76
|
-
tenants: {
|
|
77
|
-
getTenant: KnockTool;
|
|
78
|
-
setTenant: KnockTool;
|
|
79
|
-
deleteTenant: KnockTool;
|
|
80
|
-
};
|
|
81
|
-
users: {
|
|
82
|
-
getUser: KnockTool;
|
|
83
|
-
deleteUser: KnockTool;
|
|
84
|
-
createOrUpdateUser: KnockTool;
|
|
85
|
-
getUserPreferences: KnockTool;
|
|
86
|
-
setUserPreferences: KnockTool;
|
|
87
|
-
getUserMessages: KnockTool;
|
|
88
|
-
};
|
|
89
|
-
workflows: {
|
|
90
|
-
listWorkflows: KnockTool;
|
|
91
|
-
triggerWorkflow: KnockTool;
|
|
92
|
-
createEmailWorkflow: KnockTool;
|
|
93
|
-
createOneOffWorkflowSchedule: KnockTool;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
declare const allTools: {
|
|
97
|
-
listWorkflows: KnockTool;
|
|
98
|
-
triggerWorkflow: KnockTool;
|
|
99
|
-
createEmailWorkflow: KnockTool;
|
|
100
|
-
createOneOffWorkflowSchedule: KnockTool;
|
|
101
|
-
getUser: KnockTool;
|
|
102
|
-
deleteUser: KnockTool;
|
|
103
|
-
createOrUpdateUser: KnockTool;
|
|
104
|
-
getUserPreferences: KnockTool;
|
|
105
|
-
setUserPreferences: KnockTool;
|
|
106
|
-
getUserMessages: KnockTool;
|
|
107
|
-
getTenant: KnockTool;
|
|
108
|
-
setTenant: KnockTool;
|
|
109
|
-
deleteTenant: KnockTool;
|
|
110
|
-
listPartials: KnockTool;
|
|
111
|
-
listObjects: KnockTool;
|
|
112
|
-
getObject: KnockTool;
|
|
113
|
-
createOrUpdateObject: KnockTool;
|
|
114
|
-
deleteObject: KnockTool;
|
|
115
|
-
subscribeUsersToObject: KnockTool;
|
|
116
|
-
unsubscribeUsersFromObject: KnockTool;
|
|
117
|
-
getMessageContent: KnockTool;
|
|
118
|
-
listMessageTypes: KnockTool;
|
|
119
|
-
createOrUpdateMessageType: KnockTool;
|
|
120
|
-
listEnvironments: KnockTool;
|
|
121
|
-
listEmailLayouts: KnockTool;
|
|
122
|
-
listCommits: KnockTool;
|
|
123
|
-
commitAllChanges: KnockTool;
|
|
124
|
-
promoteAllCommits: KnockTool;
|
|
125
|
-
listChannels: KnockTool;
|
|
126
|
-
};
|
|
127
|
-
declare const toolPermissions: {
|
|
128
|
-
channels: {
|
|
129
|
-
read: string[];
|
|
130
|
-
};
|
|
131
|
-
commits: {
|
|
132
|
-
read: string[];
|
|
133
|
-
manage: string[];
|
|
134
|
-
};
|
|
135
|
-
emailLayouts: {
|
|
136
|
-
read: string[];
|
|
137
|
-
};
|
|
138
|
-
environments: {
|
|
139
|
-
read: string[];
|
|
140
|
-
};
|
|
141
|
-
messages: {
|
|
142
|
-
read: string[];
|
|
143
|
-
};
|
|
144
|
-
messageTypes: {
|
|
145
|
-
read: string[];
|
|
146
|
-
manage: string[];
|
|
147
|
-
};
|
|
148
|
-
objects: {
|
|
149
|
-
read: string[];
|
|
150
|
-
manage: string[];
|
|
151
|
-
};
|
|
152
|
-
partials: {
|
|
153
|
-
read: string[];
|
|
154
|
-
};
|
|
155
|
-
tenants: {
|
|
156
|
-
read: string[];
|
|
157
|
-
manage: string[];
|
|
158
|
-
};
|
|
159
|
-
users: {
|
|
160
|
-
read: string[];
|
|
161
|
-
manage: string[];
|
|
162
|
-
};
|
|
163
|
-
workflows: {
|
|
164
|
-
read: string[];
|
|
165
|
-
manage: string[];
|
|
166
|
-
trigger: string[];
|
|
167
|
-
};
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
interface Config {
|
|
171
|
-
/**
|
|
172
|
-
* The token to use to authenticate with the service.
|
|
173
|
-
*/
|
|
174
|
-
serviceToken: string;
|
|
175
|
-
/**
|
|
176
|
-
* When set calls will be made as this user.
|
|
177
|
-
*/
|
|
178
|
-
userId?: string | undefined;
|
|
179
|
-
/**
|
|
180
|
-
* When set calls will be made in this tenant context.
|
|
181
|
-
*/
|
|
182
|
-
tenantId?: string | undefined;
|
|
183
|
-
/**
|
|
184
|
-
* The environment to use as the basis for the API calls. When not defined, will default to
|
|
185
|
-
* the `development` environment.
|
|
186
|
-
*/
|
|
187
|
-
environment?: string | undefined;
|
|
188
|
-
}
|
|
189
|
-
type TransformPermissions<T> = {
|
|
190
|
-
[K in keyof T]?: {
|
|
191
|
-
[P in keyof T[K]]?: boolean;
|
|
192
|
-
};
|
|
193
|
-
};
|
|
194
|
-
interface ToolkitConfig extends Config {
|
|
195
|
-
permissions: TransformPermissions<typeof toolPermissions>;
|
|
196
|
-
}
|
|
197
|
-
type ToolCategory = keyof typeof toolPermissions;
|
|
198
|
-
|
|
199
|
-
export { type Config as C, type KnockClient as K, type ToolkitConfig as T, KnockTool as a, type ToolCategory as b, createKnockClient as c, type KnockToolDefinition as d, tools as e, allTools as f, type TransformPermissions as g, toolPermissions as t };
|
package/dist/types.d.ts
DELETED
package/dist/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|