@knocklabs/agent-toolkit 0.5.2 → 0.5.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 +4 -1
- package/dist/ai-sdk/index.js +2 -2
- package/dist/{chunk-2KLDMVOD.js → chunk-7U5HNTEY.js} +153 -29
- package/dist/chunk-7U5HNTEY.js.map +1 -0
- package/dist/{chunk-ZNG6J5G2.js → chunk-HIHS5S2N.js} +3 -3
- package/dist/{chunk-ZIHENQL2.js → chunk-YOH7QKTM.js} +6 -2
- package/dist/chunk-YOH7QKTM.js.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +18 -0
- package/dist/core/index.js.map +1 -0
- package/dist/human-in-the-loop.d.ts +2 -2
- package/dist/index-qFGypkX3.d.ts +272 -0
- package/dist/langchain/index.d.ts +4 -1
- package/dist/langchain/index.js +2 -2
- package/dist/mastra/index.d.ts +3 -1
- package/dist/mastra/index.js +2 -2
- package/dist/modelcontextprotocol/index.d.ts +2 -36
- package/dist/modelcontextprotocol/index.js +2 -2
- package/dist/modelcontextprotocol/local-server.js +5 -5
- package/dist/openai/index.d.ts +4 -1
- package/dist/openai/index.js +2 -2
- package/dist/types.d.ts +4 -108
- package/package.json +5 -1
- package/dist/chunk-2KLDMVOD.js.map +0 -1
- package/dist/chunk-ZIHENQL2.js.map +0 -1
- package/dist/knock-client-BH7Juvis.d.ts +0 -10
- /package/dist/{chunk-ZNG6J5G2.js.map → chunk-HIHS5S2N.js.map} +0 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { ZodObject } from 'zod';
|
|
2
|
+
import KnockMgmt from '@knocklabs/mgmt';
|
|
3
|
+
import { Knock } from '@knocklabs/node';
|
|
4
|
+
|
|
5
|
+
type KnockClient = ReturnType<typeof createKnockClient>;
|
|
6
|
+
declare const createKnockClient: (config: Config) => KnockMgmt & {
|
|
7
|
+
publicApi: (environmentSlug?: 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
|
+
documentation: {
|
|
53
|
+
searchDocumentation: KnockTool;
|
|
54
|
+
};
|
|
55
|
+
emailLayouts: {
|
|
56
|
+
getEmailLayout: KnockTool;
|
|
57
|
+
listEmailLayouts: KnockTool;
|
|
58
|
+
createOrUpdateEmailLayout: KnockTool;
|
|
59
|
+
};
|
|
60
|
+
environments: {
|
|
61
|
+
listEnvironments: KnockTool;
|
|
62
|
+
};
|
|
63
|
+
guides: {
|
|
64
|
+
listGuides: KnockTool;
|
|
65
|
+
getGuide: KnockTool;
|
|
66
|
+
createOrUpdateGuide: KnockTool;
|
|
67
|
+
};
|
|
68
|
+
messages: {
|
|
69
|
+
getMessage: KnockTool;
|
|
70
|
+
getMessageContent: KnockTool;
|
|
71
|
+
getMessageDeliveryLogs: KnockTool;
|
|
72
|
+
getMessageEvents: KnockTool;
|
|
73
|
+
};
|
|
74
|
+
messageTypes: {
|
|
75
|
+
listMessageTypes: KnockTool;
|
|
76
|
+
createOrUpdateMessageType: KnockTool;
|
|
77
|
+
};
|
|
78
|
+
objects: {
|
|
79
|
+
listObjects: KnockTool;
|
|
80
|
+
getObject: KnockTool;
|
|
81
|
+
createOrUpdateObject: KnockTool;
|
|
82
|
+
subscribeUsersToObject: KnockTool;
|
|
83
|
+
unsubscribeUsersFromObject: KnockTool;
|
|
84
|
+
};
|
|
85
|
+
partials: {
|
|
86
|
+
getPartial: KnockTool;
|
|
87
|
+
listPartials: KnockTool;
|
|
88
|
+
createOrUpdatePartial: KnockTool;
|
|
89
|
+
};
|
|
90
|
+
tenants: {
|
|
91
|
+
getTenant: KnockTool;
|
|
92
|
+
listTenants: KnockTool;
|
|
93
|
+
createOrUpdateTenant: KnockTool;
|
|
94
|
+
};
|
|
95
|
+
users: {
|
|
96
|
+
getUser: KnockTool;
|
|
97
|
+
createOrUpdateUser: KnockTool;
|
|
98
|
+
getUserPreferences: KnockTool;
|
|
99
|
+
setUserPreferences: KnockTool;
|
|
100
|
+
getUserMessages: KnockTool;
|
|
101
|
+
};
|
|
102
|
+
workflows: {
|
|
103
|
+
createOneOffWorkflowSchedule: KnockTool;
|
|
104
|
+
createOrUpdateEmailStepInWorkflow: KnockTool;
|
|
105
|
+
createOrUpdateSmsStepInWorkflow: KnockTool;
|
|
106
|
+
createOrUpdatePushStepInWorkflow: KnockTool;
|
|
107
|
+
createOrUpdateInAppFeedStepInWorkflow: KnockTool;
|
|
108
|
+
createOrUpdateChatStepInWorkflow: KnockTool;
|
|
109
|
+
createOrUpdateDelayStepInWorkflow: KnockTool;
|
|
110
|
+
createOrUpdateBatchStepInWorkflow: KnockTool;
|
|
111
|
+
listWorkflows: KnockTool;
|
|
112
|
+
getWorkflow: KnockTool;
|
|
113
|
+
triggerWorkflow: KnockTool;
|
|
114
|
+
createWorkflow: KnockTool;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
declare const allTools: {
|
|
118
|
+
createOneOffWorkflowSchedule: KnockTool;
|
|
119
|
+
createOrUpdateEmailStepInWorkflow: KnockTool;
|
|
120
|
+
createOrUpdateSmsStepInWorkflow: KnockTool;
|
|
121
|
+
createOrUpdatePushStepInWorkflow: KnockTool;
|
|
122
|
+
createOrUpdateInAppFeedStepInWorkflow: KnockTool;
|
|
123
|
+
createOrUpdateChatStepInWorkflow: KnockTool;
|
|
124
|
+
createOrUpdateDelayStepInWorkflow: KnockTool;
|
|
125
|
+
createOrUpdateBatchStepInWorkflow: KnockTool;
|
|
126
|
+
listWorkflows: KnockTool;
|
|
127
|
+
getWorkflow: KnockTool;
|
|
128
|
+
triggerWorkflow: KnockTool;
|
|
129
|
+
createWorkflow: KnockTool;
|
|
130
|
+
getUser: KnockTool;
|
|
131
|
+
createOrUpdateUser: KnockTool;
|
|
132
|
+
getUserPreferences: KnockTool;
|
|
133
|
+
setUserPreferences: KnockTool;
|
|
134
|
+
getUserMessages: KnockTool;
|
|
135
|
+
getTenant: KnockTool;
|
|
136
|
+
listTenants: KnockTool;
|
|
137
|
+
createOrUpdateTenant: KnockTool;
|
|
138
|
+
getPartial: KnockTool;
|
|
139
|
+
listPartials: KnockTool;
|
|
140
|
+
createOrUpdatePartial: KnockTool;
|
|
141
|
+
listObjects: KnockTool;
|
|
142
|
+
getObject: KnockTool;
|
|
143
|
+
createOrUpdateObject: KnockTool;
|
|
144
|
+
subscribeUsersToObject: KnockTool;
|
|
145
|
+
unsubscribeUsersFromObject: KnockTool;
|
|
146
|
+
getMessage: KnockTool;
|
|
147
|
+
getMessageContent: KnockTool;
|
|
148
|
+
getMessageDeliveryLogs: KnockTool;
|
|
149
|
+
getMessageEvents: KnockTool;
|
|
150
|
+
listMessageTypes: KnockTool;
|
|
151
|
+
createOrUpdateMessageType: KnockTool;
|
|
152
|
+
listGuides: KnockTool;
|
|
153
|
+
getGuide: KnockTool;
|
|
154
|
+
createOrUpdateGuide: KnockTool;
|
|
155
|
+
listEnvironments: KnockTool;
|
|
156
|
+
getEmailLayout: KnockTool;
|
|
157
|
+
listEmailLayouts: KnockTool;
|
|
158
|
+
createOrUpdateEmailLayout: KnockTool;
|
|
159
|
+
searchDocumentation: KnockTool;
|
|
160
|
+
listCommits: KnockTool;
|
|
161
|
+
commitAllChanges: KnockTool;
|
|
162
|
+
promoteAllCommits: KnockTool;
|
|
163
|
+
listChannels: KnockTool;
|
|
164
|
+
};
|
|
165
|
+
declare const toolPermissions: {
|
|
166
|
+
channels: {
|
|
167
|
+
read: string[];
|
|
168
|
+
};
|
|
169
|
+
commits: {
|
|
170
|
+
read: string[];
|
|
171
|
+
manage: string[];
|
|
172
|
+
};
|
|
173
|
+
documentation: {
|
|
174
|
+
read: string[];
|
|
175
|
+
};
|
|
176
|
+
emailLayouts: {
|
|
177
|
+
read: string[];
|
|
178
|
+
manage: string[];
|
|
179
|
+
};
|
|
180
|
+
environments: {
|
|
181
|
+
read: string[];
|
|
182
|
+
};
|
|
183
|
+
guides: {
|
|
184
|
+
read: string[];
|
|
185
|
+
manage: string[];
|
|
186
|
+
};
|
|
187
|
+
messages: {
|
|
188
|
+
read: string[];
|
|
189
|
+
};
|
|
190
|
+
messageTypes: {
|
|
191
|
+
read: string[];
|
|
192
|
+
manage: string[];
|
|
193
|
+
};
|
|
194
|
+
objects: {
|
|
195
|
+
read: string[];
|
|
196
|
+
manage: string[];
|
|
197
|
+
};
|
|
198
|
+
partials: {
|
|
199
|
+
read: string[];
|
|
200
|
+
manage: string[];
|
|
201
|
+
};
|
|
202
|
+
tenants: {
|
|
203
|
+
read: string[];
|
|
204
|
+
manage: string[];
|
|
205
|
+
};
|
|
206
|
+
users: {
|
|
207
|
+
read: string[];
|
|
208
|
+
manage: string[];
|
|
209
|
+
};
|
|
210
|
+
workflows: {
|
|
211
|
+
read: string[];
|
|
212
|
+
manage: string[];
|
|
213
|
+
trigger: never[];
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
interface Config {
|
|
218
|
+
/**
|
|
219
|
+
* The token to use to authenticate with the service. If not provided, the `serviceToken`
|
|
220
|
+
* will be resolved from `KNOCK_SERVICE_TOKEN` environment variable.
|
|
221
|
+
*/
|
|
222
|
+
serviceToken?: string | undefined;
|
|
223
|
+
/**
|
|
224
|
+
* When set calls will be made as this user.
|
|
225
|
+
*/
|
|
226
|
+
userId?: string | undefined;
|
|
227
|
+
/**
|
|
228
|
+
* When set calls will be made in this tenant context.
|
|
229
|
+
*/
|
|
230
|
+
tenantId?: string | undefined;
|
|
231
|
+
/**
|
|
232
|
+
* The environment to use as the basis for the API calls. When not defined, will default to
|
|
233
|
+
* the `development` environment.
|
|
234
|
+
*/
|
|
235
|
+
environment?: string | undefined;
|
|
236
|
+
/**
|
|
237
|
+
* Whether to hide user data from LLM responses. When true, the LLM will not have access to user
|
|
238
|
+
* data and only the ID will be returned. Defaults to `false`.
|
|
239
|
+
*/
|
|
240
|
+
hideUserData?: boolean | undefined;
|
|
241
|
+
}
|
|
242
|
+
type TransformPermissions<T> = {
|
|
243
|
+
[K in keyof T]?: {
|
|
244
|
+
[P in keyof T[K]]?: boolean;
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
interface ToolkitConfig extends Config {
|
|
248
|
+
/**
|
|
249
|
+
* The permissions to use for the toolkit.
|
|
250
|
+
*/
|
|
251
|
+
permissions: Omit<TransformPermissions<typeof toolPermissions>, "workflows"> & {
|
|
252
|
+
workflows?: {
|
|
253
|
+
/**
|
|
254
|
+
* Whether to allow reading workflows.
|
|
255
|
+
*/
|
|
256
|
+
read?: boolean | undefined;
|
|
257
|
+
/**
|
|
258
|
+
* Whether to allow managing workflows.
|
|
259
|
+
*/
|
|
260
|
+
manage?: boolean | undefined;
|
|
261
|
+
/**
|
|
262
|
+
* Optionally specify a list of workflow keys to turn into workflow trigger tools
|
|
263
|
+
*
|
|
264
|
+
* If true, all workflows will be allowed.
|
|
265
|
+
*/
|
|
266
|
+
trigger?: string[] | undefined;
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
type ToolCategory = keyof typeof toolPermissions;
|
|
271
|
+
|
|
272
|
+
export { type Config as C, type KnockClient as K, type ToolkitConfig as T, type ToolCategory as a, KnockTool as b, type TransformPermissions as c, allTools as d, toolPermissions as e, createKnockClient as f, type KnockToolDefinition as g, tools as t };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { DynamicStructuredTool } from '@langchain/core/tools';
|
|
2
|
-
import { ToolkitConfig, ToolCategory } from '../
|
|
2
|
+
import { T as ToolkitConfig, a as ToolCategory } from '../index-qFGypkX3.js';
|
|
3
|
+
import 'zod';
|
|
4
|
+
import '@knocklabs/mgmt';
|
|
5
|
+
import '@knocklabs/node';
|
|
3
6
|
|
|
4
7
|
type KnockToolkit = {
|
|
5
8
|
getAllTools: () => DynamicStructuredTool[];
|
package/dist/langchain/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createKnockClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-YOH7QKTM.js";
|
|
4
4
|
import {
|
|
5
5
|
getToolMap,
|
|
6
6
|
getToolsByPermissionsInCategories
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-7U5HNTEY.js";
|
|
8
8
|
import {
|
|
9
9
|
__commonJS,
|
|
10
10
|
__export,
|
package/dist/mastra/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Tool } from '@mastra/core/tools';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { ToolkitConfig, ToolCategory } from '../
|
|
3
|
+
import { T as ToolkitConfig, a as ToolCategory } from '../index-qFGypkX3.js';
|
|
4
|
+
import '@knocklabs/mgmt';
|
|
5
|
+
import '@knocklabs/node';
|
|
4
6
|
|
|
5
7
|
type KnockToolkit = {
|
|
6
8
|
getAllTools: () => Tool<z.ZodObject<any, any>>[];
|
package/dist/mastra/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createKnockClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-YOH7QKTM.js";
|
|
4
4
|
import {
|
|
5
5
|
getToolMap,
|
|
6
6
|
getToolsByPermissionsInCategories
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-7U5HNTEY.js";
|
|
8
8
|
import "../chunk-G3PMV62Z.js";
|
|
9
9
|
|
|
10
10
|
// src/mastra/tool-converter.ts
|
|
@@ -1,43 +1,9 @@
|
|
|
1
|
-
import { K as KnockClient } from '../
|
|
2
|
-
import { ZodObject } from 'zod';
|
|
3
|
-
import { Config } from '../types.js';
|
|
1
|
+
import { K as KnockClient, C as Config, b as KnockTool } from '../index-qFGypkX3.js';
|
|
4
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import 'zod';
|
|
5
4
|
import '@knocklabs/mgmt';
|
|
6
5
|
import '@knocklabs/node';
|
|
7
6
|
|
|
8
|
-
interface KnockToolDefinition {
|
|
9
|
-
/**
|
|
10
|
-
* The method name of the tool. This is a machine-readable string.
|
|
11
|
-
*/
|
|
12
|
-
method: string;
|
|
13
|
-
/**
|
|
14
|
-
* The name of the tool. This can be used to reference the tool in the code.
|
|
15
|
-
* A descriptive LLM-readable string.
|
|
16
|
-
*/
|
|
17
|
-
name: string;
|
|
18
|
-
/**
|
|
19
|
-
* A descriptive prompt explaining the tool's purpose, including examples where useful.
|
|
20
|
-
*/
|
|
21
|
-
description: string;
|
|
22
|
-
/**
|
|
23
|
-
* A descriptive prompt explaining the tool's purpose, usage and input parameters.
|
|
24
|
-
* Ths is intended to be used by the underlying LLM.
|
|
25
|
-
*/
|
|
26
|
-
fullDescription: string;
|
|
27
|
-
/**
|
|
28
|
-
* The Zod schema for the input parameters of the tool
|
|
29
|
-
*/
|
|
30
|
-
parameters?: ZodObject<any>;
|
|
31
|
-
/**
|
|
32
|
-
* The actual implementation of the tool.
|
|
33
|
-
*/
|
|
34
|
-
execute: (knockClient: KnockClient, config: Config) => (input: any) => Promise<unknown>;
|
|
35
|
-
}
|
|
36
|
-
interface KnockTool extends Omit<KnockToolDefinition, "execute"> {
|
|
37
|
-
bindExecute: (knockClient: KnockClient, config: Config) => (input: any) => Promise<unknown>;
|
|
38
|
-
}
|
|
39
|
-
declare const KnockTool: (args: Omit<KnockToolDefinition, "fullDescription">) => KnockTool;
|
|
40
|
-
|
|
41
7
|
declare class KnockMcpServer extends McpServer {
|
|
42
8
|
constructor(knockClient: KnockClient, config: Config, tools: KnockTool[]);
|
|
43
9
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
createKnockMcpServer
|
|
4
|
-
} from "../chunk-ZNG6J5G2.js";
|
|
5
2
|
import {
|
|
6
3
|
createKnockClient
|
|
7
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-YOH7QKTM.js";
|
|
5
|
+
import {
|
|
6
|
+
createKnockMcpServer
|
|
7
|
+
} from "../chunk-HIHS5S2N.js";
|
|
8
8
|
import {
|
|
9
9
|
filterTools,
|
|
10
10
|
tools
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-7U5HNTEY.js";
|
|
12
12
|
import "../chunk-G3PMV62Z.js";
|
|
13
13
|
|
|
14
14
|
// src/modelcontextprotocol/local-server.ts
|
package/dist/openai/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ChatCompletionTool, ChatCompletionMessageToolCall, ChatCompletionToolMessageParam } from 'openai/resources.mjs';
|
|
2
|
-
import { ToolkitConfig, ToolCategory } from '../
|
|
2
|
+
import { T as ToolkitConfig, a as ToolCategory } from '../index-qFGypkX3.js';
|
|
3
|
+
import 'zod';
|
|
4
|
+
import '@knocklabs/mgmt';
|
|
5
|
+
import '@knocklabs/node';
|
|
3
6
|
|
|
4
7
|
type KnockToolkit = {
|
|
5
8
|
getAllTools: () => ChatCompletionTool[];
|
package/dist/openai/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createKnockClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-YOH7QKTM.js";
|
|
4
4
|
import {
|
|
5
5
|
getToolMap,
|
|
6
6
|
getToolsByPermissionsInCategories
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-7U5HNTEY.js";
|
|
8
8
|
import "../chunk-G3PMV62Z.js";
|
|
9
9
|
|
|
10
10
|
// src/openai/tool-converter.ts
|
package/dist/types.d.ts
CHANGED
|
@@ -1,108 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
commits: {
|
|
6
|
-
read: string[];
|
|
7
|
-
manage: string[];
|
|
8
|
-
};
|
|
9
|
-
documentation: {
|
|
10
|
-
read: string[];
|
|
11
|
-
};
|
|
12
|
-
emailLayouts: {
|
|
13
|
-
read: string[];
|
|
14
|
-
manage: string[];
|
|
15
|
-
};
|
|
16
|
-
environments: {
|
|
17
|
-
read: string[];
|
|
18
|
-
};
|
|
19
|
-
guides: {
|
|
20
|
-
read: string[];
|
|
21
|
-
manage: string[];
|
|
22
|
-
};
|
|
23
|
-
messages: {
|
|
24
|
-
read: string[];
|
|
25
|
-
};
|
|
26
|
-
messageTypes: {
|
|
27
|
-
read: string[];
|
|
28
|
-
manage: string[];
|
|
29
|
-
};
|
|
30
|
-
objects: {
|
|
31
|
-
read: string[];
|
|
32
|
-
manage: string[];
|
|
33
|
-
};
|
|
34
|
-
partials: {
|
|
35
|
-
read: string[];
|
|
36
|
-
manage: string[];
|
|
37
|
-
};
|
|
38
|
-
tenants: {
|
|
39
|
-
read: string[];
|
|
40
|
-
manage: string[];
|
|
41
|
-
};
|
|
42
|
-
users: {
|
|
43
|
-
read: string[];
|
|
44
|
-
manage: string[];
|
|
45
|
-
};
|
|
46
|
-
workflows: {
|
|
47
|
-
read: string[];
|
|
48
|
-
manage: string[];
|
|
49
|
-
trigger: never[];
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
interface Config {
|
|
54
|
-
/**
|
|
55
|
-
* The token to use to authenticate with the service. If not provided, the `serviceToken`
|
|
56
|
-
* will be resolved from `KNOCK_SERVICE_TOKEN` environment variable.
|
|
57
|
-
*/
|
|
58
|
-
serviceToken?: string | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* When set calls will be made as this user.
|
|
61
|
-
*/
|
|
62
|
-
userId?: string | undefined;
|
|
63
|
-
/**
|
|
64
|
-
* When set calls will be made in this tenant context.
|
|
65
|
-
*/
|
|
66
|
-
tenantId?: string | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* The environment to use as the basis for the API calls. When not defined, will default to
|
|
69
|
-
* the `development` environment.
|
|
70
|
-
*/
|
|
71
|
-
environment?: string | undefined;
|
|
72
|
-
/**
|
|
73
|
-
* Whether to hide user data from LLM responses. When true, the LLM will not have access to user
|
|
74
|
-
* data and only the ID will be returned. Defaults to `false`.
|
|
75
|
-
*/
|
|
76
|
-
hideUserData?: boolean | undefined;
|
|
77
|
-
}
|
|
78
|
-
type TransformPermissions<T> = {
|
|
79
|
-
[K in keyof T]?: {
|
|
80
|
-
[P in keyof T[K]]?: boolean;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
interface ToolkitConfig extends Config {
|
|
84
|
-
/**
|
|
85
|
-
* The permissions to use for the toolkit.
|
|
86
|
-
*/
|
|
87
|
-
permissions: Omit<TransformPermissions<typeof toolPermissions>, "workflows"> & {
|
|
88
|
-
workflows?: {
|
|
89
|
-
/**
|
|
90
|
-
* Whether to allow reading workflows.
|
|
91
|
-
*/
|
|
92
|
-
read?: boolean | undefined;
|
|
93
|
-
/**
|
|
94
|
-
* Whether to allow managing workflows.
|
|
95
|
-
*/
|
|
96
|
-
manage?: boolean | undefined;
|
|
97
|
-
/**
|
|
98
|
-
* Optionally specify a list of workflow keys to turn into workflow trigger tools
|
|
99
|
-
*
|
|
100
|
-
* If true, all workflows will be allowed.
|
|
101
|
-
*/
|
|
102
|
-
trigger?: string[] | undefined;
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
type ToolCategory = keyof typeof toolPermissions;
|
|
107
|
-
|
|
108
|
-
export type { Config, ToolCategory, ToolkitConfig, TransformPermissions };
|
|
1
|
+
export { C as Config, a as ToolCategory, T as ToolkitConfig, c as TransformPermissions } from './index-qFGypkX3.js';
|
|
2
|
+
import 'zod';
|
|
3
|
+
import '@knocklabs/mgmt';
|
|
4
|
+
import '@knocklabs/node';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knocklabs/agent-toolkit",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "A toolkit for working with Knock in Agent workflows.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -47,6 +47,10 @@
|
|
|
47
47
|
},
|
|
48
48
|
"./types": {
|
|
49
49
|
"types": "./dist/types.d.ts"
|
|
50
|
+
},
|
|
51
|
+
"./core": {
|
|
52
|
+
"types": "./dist/core/index.d.ts",
|
|
53
|
+
"default": "./dist/core/index.js"
|
|
50
54
|
}
|
|
51
55
|
},
|
|
52
56
|
"bin": {
|