@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.
Files changed (112) hide show
  1. package/dist/ai-sdk/index.d.ts +1 -4
  2. package/dist/ai-sdk/index.js +14 -20
  3. package/dist/ai-sdk/index.js.map +1 -1
  4. package/dist/{chunk-XUYE3AGB.js → chunk-B6DIDKFY.js} +14 -2
  5. package/dist/chunk-B6DIDKFY.js.map +1 -0
  6. package/dist/chunk-RPKDXX4O.js +1023 -0
  7. package/dist/chunk-RPKDXX4O.js.map +1 -0
  8. package/dist/{chunk-4VR65G5W.js → chunk-ZV2SOIO7.js} +29 -4
  9. package/dist/chunk-ZV2SOIO7.js.map +1 -0
  10. package/dist/modelcontextprotocol/index.d.ts +47 -6
  11. package/dist/modelcontextprotocol/index.js +2 -15
  12. package/dist/modelcontextprotocol/local-server.js +5 -20
  13. package/dist/modelcontextprotocol/local-server.js.map +1 -1
  14. package/dist/openai/index.d.ts +1 -4
  15. package/dist/openai/index.js +18 -20
  16. package/dist/openai/index.js.map +1 -1
  17. package/dist/types-DyB12-Gk.d.ts +73 -0
  18. package/package.json +2 -2
  19. package/dist/ai-sdk/tool-converter.d.ts +0 -12
  20. package/dist/ai-sdk/tool-converter.js +0 -7
  21. package/dist/ai-sdk/tool-converter.js.map +0 -1
  22. package/dist/chunk-2CNJ4XX6.js +0 -33
  23. package/dist/chunk-2CNJ4XX6.js.map +0 -1
  24. package/dist/chunk-3LZK6RH6.js +0 -29
  25. package/dist/chunk-3LZK6RH6.js.map +0 -1
  26. package/dist/chunk-4VR65G5W.js.map +0 -1
  27. package/dist/chunk-6H3BXH2Y.js +0 -15
  28. package/dist/chunk-6H3BXH2Y.js.map +0 -1
  29. package/dist/chunk-BY4KQPUO.js +0 -39
  30. package/dist/chunk-BY4KQPUO.js.map +0 -1
  31. package/dist/chunk-DSRTYV37.js +0 -39
  32. package/dist/chunk-DSRTYV37.js.map +0 -1
  33. package/dist/chunk-JTYQTWCX.js +0 -75
  34. package/dist/chunk-JTYQTWCX.js.map +0 -1
  35. package/dist/chunk-NZB2TMJW.js +0 -92
  36. package/dist/chunk-NZB2TMJW.js.map +0 -1
  37. package/dist/chunk-O6DWF42E.js +0 -31
  38. package/dist/chunk-O6DWF42E.js.map +0 -1
  39. package/dist/chunk-OD5VHBGN.js +0 -32
  40. package/dist/chunk-OD5VHBGN.js.map +0 -1
  41. package/dist/chunk-PDMA6RIB.js +0 -19
  42. package/dist/chunk-PDMA6RIB.js.map +0 -1
  43. package/dist/chunk-RYMJEH6P.js +0 -140
  44. package/dist/chunk-RYMJEH6P.js.map +0 -1
  45. package/dist/chunk-THLK376Y.js +0 -191
  46. package/dist/chunk-THLK376Y.js.map +0 -1
  47. package/dist/chunk-TLHETJRF.js +0 -75
  48. package/dist/chunk-TLHETJRF.js.map +0 -1
  49. package/dist/chunk-TOBLV65T.js +0 -30
  50. package/dist/chunk-TOBLV65T.js.map +0 -1
  51. package/dist/chunk-VJFA3ZVW.js +0 -210
  52. package/dist/chunk-VJFA3ZVW.js.map +0 -1
  53. package/dist/chunk-WB4XCCUS.js +0 -19
  54. package/dist/chunk-WB4XCCUS.js.map +0 -1
  55. package/dist/chunk-XRQWR3LY.js +0 -184
  56. package/dist/chunk-XRQWR3LY.js.map +0 -1
  57. package/dist/chunk-XUYE3AGB.js.map +0 -1
  58. package/dist/lib/knock-client.d.ts +0 -4
  59. package/dist/lib/knock-client.js +0 -7
  60. package/dist/lib/knock-client.js.map +0 -1
  61. package/dist/lib/knock-tool.d.ts +0 -4
  62. package/dist/lib/knock-tool.js +0 -7
  63. package/dist/lib/knock-tool.js.map +0 -1
  64. package/dist/lib/tools/channels.d.ts +0 -13
  65. package/dist/lib/tools/channels.js +0 -10
  66. package/dist/lib/tools/channels.js.map +0 -1
  67. package/dist/lib/tools/commits.d.ts +0 -16
  68. package/dist/lib/tools/commits.js +0 -10
  69. package/dist/lib/tools/commits.js.map +0 -1
  70. package/dist/lib/tools/email-layouts.d.ts +0 -13
  71. package/dist/lib/tools/email-layouts.js +0 -10
  72. package/dist/lib/tools/email-layouts.js.map +0 -1
  73. package/dist/lib/tools/environments.d.ts +0 -13
  74. package/dist/lib/tools/environments.js +0 -10
  75. package/dist/lib/tools/environments.js.map +0 -1
  76. package/dist/lib/tools/index.d.ts +0 -4
  77. package/dist/lib/tools/index.js +0 -23
  78. package/dist/lib/tools/index.js.map +0 -1
  79. package/dist/lib/tools/message-types.d.ts +0 -15
  80. package/dist/lib/tools/message-types.js +0 -10
  81. package/dist/lib/tools/message-types.js.map +0 -1
  82. package/dist/lib/tools/messages.d.ts +0 -13
  83. package/dist/lib/tools/messages.js +0 -10
  84. package/dist/lib/tools/messages.js.map +0 -1
  85. package/dist/lib/tools/objects.d.ts +0 -19
  86. package/dist/lib/tools/objects.js +0 -10
  87. package/dist/lib/tools/objects.js.map +0 -1
  88. package/dist/lib/tools/partials.d.ts +0 -13
  89. package/dist/lib/tools/partials.js +0 -10
  90. package/dist/lib/tools/partials.js.map +0 -1
  91. package/dist/lib/tools/tenants.d.ts +0 -16
  92. package/dist/lib/tools/tenants.js +0 -10
  93. package/dist/lib/tools/tenants.js.map +0 -1
  94. package/dist/lib/tools/users.d.ts +0 -19
  95. package/dist/lib/tools/users.js +0 -10
  96. package/dist/lib/tools/users.js.map +0 -1
  97. package/dist/lib/tools/workflows.d.ts +0 -18
  98. package/dist/lib/tools/workflows.js +0 -10
  99. package/dist/lib/tools/workflows.js.map +0 -1
  100. package/dist/lib/utils.d.ts +0 -33
  101. package/dist/lib/utils.js +0 -24
  102. package/dist/lib/utils.js.map +0 -1
  103. package/dist/modelcontextprotocol/adapter.d.ts +0 -11
  104. package/dist/modelcontextprotocol/adapter.js +0 -7
  105. package/dist/modelcontextprotocol/adapter.js.map +0 -1
  106. package/dist/openai/tool-converter.d.ts +0 -15
  107. package/dist/openai/tool-converter.js +0 -7
  108. package/dist/openai/tool-converter.js.map +0 -1
  109. package/dist/types-B-9pppCQ.d.ts +0 -199
  110. package/dist/types.d.ts +0 -4
  111. package/dist/types.js +0 -1
  112. package/dist/types.js.map +0 -1
@@ -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
@@ -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,7 +0,0 @@
1
- import {
2
- KnockMcpServer
3
- } from "../chunk-XUYE3AGB.js";
4
- export {
5
- KnockMcpServer
6
- };
7
- //# sourceMappingURL=adapter.js.map
@@ -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,7 +0,0 @@
1
- import {
2
- knockToolToChatCompletionTool
3
- } from "../chunk-WB4XCCUS.js";
4
- export {
5
- knockToolToChatCompletionTool
6
- };
7
- //# sourceMappingURL=tool-converter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -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
@@ -1,4 +0,0 @@
1
- export { C as Config, b as ToolCategory, T as ToolkitConfig, g as TransformPermissions } from './types-B-9pppCQ.js';
2
- import 'zod';
3
- import '@knocklabs/node';
4
- import '@knocklabs/mgmt';
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":[]}