@knocklabs/agent-toolkit 0.1.2 → 0.1.3
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.js +22 -1085
- package/dist/ai-sdk/index.js.map +1 -1
- package/dist/ai-sdk/tool-converter.js +3 -10
- package/dist/ai-sdk/tool-converter.js.map +1 -1
- package/dist/chunk-2CNJ4XX6.js +33 -0
- package/dist/chunk-2CNJ4XX6.js.map +1 -0
- package/dist/chunk-3LZK6RH6.js +29 -0
- package/dist/chunk-3LZK6RH6.js.map +1 -0
- package/dist/chunk-4VR65G5W.js +66 -0
- package/dist/chunk-4VR65G5W.js.map +1 -0
- package/dist/chunk-6H3BXH2Y.js +15 -0
- package/dist/chunk-6H3BXH2Y.js.map +1 -0
- package/dist/chunk-BY4KQPUO.js +39 -0
- package/dist/chunk-BY4KQPUO.js.map +1 -0
- package/dist/chunk-DSRTYV37.js +39 -0
- package/dist/chunk-DSRTYV37.js.map +1 -0
- package/dist/chunk-JTYQTWCX.js +75 -0
- package/dist/chunk-JTYQTWCX.js.map +1 -0
- package/dist/chunk-NZB2TMJW.js +92 -0
- package/dist/chunk-NZB2TMJW.js.map +1 -0
- package/dist/chunk-O6DWF42E.js +31 -0
- package/dist/chunk-O6DWF42E.js.map +1 -0
- package/dist/chunk-OD5VHBGN.js +32 -0
- package/dist/chunk-OD5VHBGN.js.map +1 -0
- package/dist/chunk-PDMA6RIB.js +19 -0
- package/dist/chunk-PDMA6RIB.js.map +1 -0
- package/dist/chunk-RYMJEH6P.js +140 -0
- package/dist/chunk-RYMJEH6P.js.map +1 -0
- package/dist/chunk-THLK376Y.js +191 -0
- package/dist/chunk-THLK376Y.js.map +1 -0
- package/dist/chunk-TLHETJRF.js +75 -0
- package/dist/chunk-TLHETJRF.js.map +1 -0
- package/dist/chunk-TOBLV65T.js +30 -0
- package/dist/chunk-TOBLV65T.js.map +1 -0
- package/dist/chunk-VJFA3ZVW.js +210 -0
- package/dist/chunk-VJFA3ZVW.js.map +1 -0
- package/dist/chunk-WB4XCCUS.js +19 -0
- package/dist/chunk-WB4XCCUS.js.map +1 -0
- package/dist/chunk-XRQWR3LY.js +184 -0
- package/dist/chunk-XRQWR3LY.js.map +1 -0
- package/dist/chunk-XUYE3AGB.js +27 -0
- package/dist/chunk-XUYE3AGB.js.map +1 -0
- package/dist/lib/knock-client.js +3 -24
- package/dist/lib/knock-client.js.map +1 -1
- package/dist/lib/knock-tool.js +3 -25
- package/dist/lib/knock-tool.js.map +1 -1
- package/dist/lib/tools/channels.js +5 -49
- package/dist/lib/tools/channels.js.map +1 -1
- package/dist/lib/tools/commits.js +5 -93
- package/dist/lib/tools/commits.js.map +1 -1
- package/dist/lib/tools/email-layouts.js +5 -55
- package/dist/lib/tools/email-layouts.js.map +1 -1
- package/dist/lib/tools/environments.js +5 -47
- package/dist/lib/tools/environments.js.map +1 -1
- package/dist/lib/tools/index.js +17 -1016
- package/dist/lib/tools/index.js.map +1 -1
- package/dist/lib/tools/message-types.js +5 -209
- package/dist/lib/tools/message-types.js.map +1 -1
- package/dist/lib/tools/messages.js +5 -50
- package/dist/lib/tools/messages.js.map +1 -1
- package/dist/lib/tools/objects.js +5 -158
- package/dist/lib/tools/objects.js.map +1 -1
- package/dist/lib/tools/partials.js +5 -55
- package/dist/lib/tools/partials.js.map +1 -1
- package/dist/lib/tools/tenants.js +5 -93
- package/dist/lib/tools/tenants.js.map +1 -1
- package/dist/lib/tools/users.js +5 -228
- package/dist/lib/tools/users.js.map +1 -1
- package/dist/lib/tools/workflows.js +5 -202
- package/dist/lib/tools/workflows.js.map +1 -1
- package/dist/lib/utils.js +18 -1071
- package/dist/lib/utils.js.map +1 -1
- package/dist/modelcontextprotocol/adapter.js +3 -22
- package/dist/modelcontextprotocol/adapter.js.map +1 -1
- package/dist/modelcontextprotocol/index.js +17 -976
- package/dist/modelcontextprotocol/index.js.map +1 -1
- package/dist/modelcontextprotocol/local-server.js +25 -1041
- package/dist/modelcontextprotocol/local-server.js.map +1 -1
- package/dist/openai/index.js +22 -1089
- package/dist/openai/index.js.map +1 -1
- package/dist/openai/tool-converter.js +3 -14
- package/dist/openai/tool-converter.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,52 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const parameters = restOfArgs.parameters ? restOfArgs.parameters : z.object({});
|
|
7
|
-
const schemaEntries = Object.entries(parameters.shape);
|
|
8
|
-
const argsStr = schemaEntries.length === 0 ? "Takes no arguments" : schemaEntries.map(([key, value]) => {
|
|
9
|
-
return `- ${key}: ${value.description || ""}`;
|
|
10
|
-
}).join("\n");
|
|
11
|
-
const fullDescription = trimLines(`
|
|
12
|
-
Tool name:
|
|
13
|
-
${args.name}
|
|
14
|
-
Description:
|
|
15
|
-
${args.description}.
|
|
16
|
-
Arguments:
|
|
17
|
-
${argsStr}
|
|
18
|
-
`);
|
|
19
|
-
return {
|
|
20
|
-
...restOfArgs,
|
|
21
|
-
parameters,
|
|
22
|
-
fullDescription,
|
|
23
|
-
bindExecute: (knockClient, config) => execute(knockClient, config)
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
// src/lib/tools/channels.ts
|
|
28
|
-
var listChannels = KnockTool({
|
|
29
|
-
method: "list_channels",
|
|
30
|
-
name: "List channels",
|
|
31
|
-
description: `
|
|
32
|
-
Returns a list of all of the channels configured in the account. Each channel returns information about the type of channel it is (email, sms, push, etc), and the provider that's used to power the channel.
|
|
33
|
-
|
|
34
|
-
Use this tool when you need to know about the channels configured in the Knock account, like when configuring a workflow.
|
|
35
|
-
`,
|
|
36
|
-
execute: (knockClient) => async (params) => {
|
|
37
|
-
const allChannels = [];
|
|
38
|
-
for await (const channel of knockClient.channels.list()) {
|
|
39
|
-
allChannels.push(channel);
|
|
40
|
-
}
|
|
41
|
-
return allChannels;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
var channels = {
|
|
45
|
-
listChannels
|
|
46
|
-
};
|
|
47
|
-
var permissions = {
|
|
48
|
-
read: ["listChannels"]
|
|
49
|
-
};
|
|
1
|
+
import {
|
|
2
|
+
channels,
|
|
3
|
+
permissions
|
|
4
|
+
} from "../../chunk-2CNJ4XX6.js";
|
|
5
|
+
import "../../chunk-TOBLV65T.js";
|
|
50
6
|
export {
|
|
51
7
|
channels,
|
|
52
8
|
permissions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,96 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
var trimLines = (text) => text.split("\n").map((l) => l.trim()).filter(Boolean).join("\n");
|
|
7
|
-
var KnockTool = (args) => {
|
|
8
|
-
const { execute, ...restOfArgs } = args;
|
|
9
|
-
const parameters = restOfArgs.parameters ? restOfArgs.parameters : z.object({});
|
|
10
|
-
const schemaEntries = Object.entries(parameters.shape);
|
|
11
|
-
const argsStr = schemaEntries.length === 0 ? "Takes no arguments" : schemaEntries.map(([key, value]) => {
|
|
12
|
-
return `- ${key}: ${value.description || ""}`;
|
|
13
|
-
}).join("\n");
|
|
14
|
-
const fullDescription = trimLines(`
|
|
15
|
-
Tool name:
|
|
16
|
-
${args.name}
|
|
17
|
-
Description:
|
|
18
|
-
${args.description}.
|
|
19
|
-
Arguments:
|
|
20
|
-
${argsStr}
|
|
21
|
-
`);
|
|
22
|
-
return {
|
|
23
|
-
...restOfArgs,
|
|
24
|
-
parameters,
|
|
25
|
-
fullDescription,
|
|
26
|
-
bindExecute: (knockClient, config) => execute(knockClient, config)
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
// src/lib/tools/commits.ts
|
|
31
|
-
var listCommits = KnockTool({
|
|
32
|
-
method: "list_commits",
|
|
33
|
-
name: "List commits",
|
|
34
|
-
description: `
|
|
35
|
-
Returns all commits available in the environment. Use this tool when you are asked to see what changes are available to be deployed.
|
|
36
|
-
`,
|
|
37
|
-
parameters: z2.object({
|
|
38
|
-
environment: z2.string().describe(
|
|
39
|
-
"(string): The environment to list commits for. Defaults to `development`."
|
|
40
|
-
),
|
|
41
|
-
promoted: z2.boolean().describe(
|
|
42
|
-
"(boolean): Whether to only return promoted commits. Defaults to `false`."
|
|
43
|
-
)
|
|
44
|
-
}),
|
|
45
|
-
execute: (knockClient, config) => async (params) => {
|
|
46
|
-
return await knockClient.commits.list({
|
|
47
|
-
environment: params.environment ?? config.environment ?? "development",
|
|
48
|
-
promoted: params.promoted ?? false
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
var commitAllChanges = KnockTool({
|
|
53
|
-
method: "commit_all_changes",
|
|
54
|
-
name: "Commit all changes",
|
|
55
|
-
description: `
|
|
56
|
-
Commit all pending changes to the current environment. Use this tool when you are asked to save all changes to the current environment. This can only be used in the development environment.
|
|
57
|
-
`,
|
|
58
|
-
parameters: z2.object({
|
|
59
|
-
message: z2.string().describe("(string): The message to include in the commit.")
|
|
60
|
-
}),
|
|
61
|
-
execute: (knockClient, config) => async (params) => {
|
|
62
|
-
return await knockClient.commits.commitAll({
|
|
63
|
-
environment: config.environment ?? "development",
|
|
64
|
-
commit_message: params.message
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
var promoteAllCommits = KnockTool({
|
|
69
|
-
method: "promote_all_commits",
|
|
70
|
-
name: "Promote all commits",
|
|
71
|
-
description: `
|
|
72
|
-
Promote all commits to the next environment. Use this tool when you are asked to deploy all changes.
|
|
73
|
-
|
|
74
|
-
When not specified, the \`toEnvironment\` will default to the environment that comes after the environment specified in the config.
|
|
75
|
-
`,
|
|
76
|
-
parameters: z2.object({
|
|
77
|
-
toEnvironment: z2.string().describe("(string): The environment to promote all commits to.")
|
|
78
|
-
}),
|
|
79
|
-
execute: (knockClient, config) => async (params) => {
|
|
80
|
-
return await knockClient.put("/v1/commits/promote", {
|
|
81
|
-
body: { to_environment: params.toEnvironment }
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
var commits = {
|
|
86
|
-
listCommits,
|
|
87
|
-
commitAllChanges,
|
|
88
|
-
promoteAllCommits
|
|
89
|
-
};
|
|
90
|
-
var permissions = {
|
|
91
|
-
read: ["listCommits"],
|
|
92
|
-
manage: ["commitAllChanges", "promoteAllCommits"]
|
|
93
|
-
};
|
|
1
|
+
import {
|
|
2
|
+
commits,
|
|
3
|
+
permissions
|
|
4
|
+
} from "../../chunk-TLHETJRF.js";
|
|
5
|
+
import "../../chunk-TOBLV65T.js";
|
|
94
6
|
export {
|
|
95
7
|
commits,
|
|
96
8
|
permissions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,58 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const parameters = restOfArgs.parameters ? restOfArgs.parameters : z.object({});
|
|
7
|
-
const schemaEntries = Object.entries(parameters.shape);
|
|
8
|
-
const argsStr = schemaEntries.length === 0 ? "Takes no arguments" : schemaEntries.map(([key, value]) => {
|
|
9
|
-
return `- ${key}: ${value.description || ""}`;
|
|
10
|
-
}).join("\n");
|
|
11
|
-
const fullDescription = trimLines(`
|
|
12
|
-
Tool name:
|
|
13
|
-
${args.name}
|
|
14
|
-
Description:
|
|
15
|
-
${args.description}.
|
|
16
|
-
Arguments:
|
|
17
|
-
${argsStr}
|
|
18
|
-
`);
|
|
19
|
-
return {
|
|
20
|
-
...restOfArgs,
|
|
21
|
-
parameters,
|
|
22
|
-
fullDescription,
|
|
23
|
-
bindExecute: (knockClient, config) => execute(knockClient, config)
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
// src/lib/tools/email-layouts.ts
|
|
28
|
-
import { z as z2 } from "zod";
|
|
29
|
-
var listEmailLayouts = KnockTool({
|
|
30
|
-
method: "list_email_layouts",
|
|
31
|
-
name: "List email layouts",
|
|
32
|
-
description: `List all email layouts within the environment given. Returns information about the email layout, including the name and the key.
|
|
33
|
-
|
|
34
|
-
Use this tool when building a workflow that is building an email notification when you need to know the available email layouts.`,
|
|
35
|
-
parameters: z2.object({
|
|
36
|
-
environment: z2.string().describe(
|
|
37
|
-
"(string): The environment to list email layouts for. Defaults to `development`."
|
|
38
|
-
)
|
|
39
|
-
}),
|
|
40
|
-
execute: (knockClient, config) => async (params) => {
|
|
41
|
-
const allEmailLayouts = [];
|
|
42
|
-
for await (const emailLayout of knockClient.emailLayouts.list({
|
|
43
|
-
environment: params.environment ?? config.environment ?? "development"
|
|
44
|
-
})) {
|
|
45
|
-
allEmailLayouts.push(emailLayout);
|
|
46
|
-
}
|
|
47
|
-
return allEmailLayouts;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
var emailLayouts = {
|
|
51
|
-
listEmailLayouts
|
|
52
|
-
};
|
|
53
|
-
var permissions = {
|
|
54
|
-
read: ["listEmailLayouts"]
|
|
55
|
-
};
|
|
1
|
+
import {
|
|
2
|
+
emailLayouts,
|
|
3
|
+
permissions
|
|
4
|
+
} from "../../chunk-DSRTYV37.js";
|
|
5
|
+
import "../../chunk-TOBLV65T.js";
|
|
56
6
|
export {
|
|
57
7
|
emailLayouts,
|
|
58
8
|
permissions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,50 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const parameters = restOfArgs.parameters ? restOfArgs.parameters : z.object({});
|
|
7
|
-
const schemaEntries = Object.entries(parameters.shape);
|
|
8
|
-
const argsStr = schemaEntries.length === 0 ? "Takes no arguments" : schemaEntries.map(([key, value]) => {
|
|
9
|
-
return `- ${key}: ${value.description || ""}`;
|
|
10
|
-
}).join("\n");
|
|
11
|
-
const fullDescription = trimLines(`
|
|
12
|
-
Tool name:
|
|
13
|
-
${args.name}
|
|
14
|
-
Description:
|
|
15
|
-
${args.description}.
|
|
16
|
-
Arguments:
|
|
17
|
-
${argsStr}
|
|
18
|
-
`);
|
|
19
|
-
return {
|
|
20
|
-
...restOfArgs,
|
|
21
|
-
parameters,
|
|
22
|
-
fullDescription,
|
|
23
|
-
bindExecute: (knockClient, config) => execute(knockClient, config)
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
// src/lib/tools/environments.ts
|
|
28
|
-
var listEnvironments = KnockTool({
|
|
29
|
-
method: "list_environments",
|
|
30
|
-
name: "List environments",
|
|
31
|
-
description: `
|
|
32
|
-
Lists all environments available, returning the slug, name, and the order of each environment. Use this tool when you need to see what environments are available to deploy to.
|
|
33
|
-
`,
|
|
34
|
-
execute: (knockClient) => async (params) => {
|
|
35
|
-
const allEnvironments = [];
|
|
36
|
-
for await (const environment of knockClient.environments.list()) {
|
|
37
|
-
allEnvironments.push(environment);
|
|
38
|
-
}
|
|
39
|
-
return allEnvironments;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
var environments = {
|
|
43
|
-
listEnvironments
|
|
44
|
-
};
|
|
45
|
-
var permissions = {
|
|
46
|
-
read: ["listEnvironments"]
|
|
47
|
-
};
|
|
1
|
+
import {
|
|
2
|
+
environments,
|
|
3
|
+
permissions
|
|
4
|
+
} from "../../chunk-O6DWF42E.js";
|
|
5
|
+
import "../../chunk-TOBLV65T.js";
|
|
48
6
|
export {
|
|
49
7
|
environments,
|
|
50
8
|
permissions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|