@rnsk/toolkits 0.0.8 → 0.0.9
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/README.md +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +17 -1
- package/dist/toolkits/bitbucket/icon.d.ts +5 -0
- package/dist/toolkits/bitbucket/icon.js +6 -0
- package/dist/toolkits/bitbucket/manifest.d.ts +3 -0
- package/dist/toolkits/bitbucket/manifest.js +56 -0
- package/dist/toolkits/bitbucket/tools/client.d.ts +38 -0
- package/dist/toolkits/bitbucket/tools/client.js +87 -0
- package/dist/toolkits/bitbucket/tools/commits.d.ts +149 -0
- package/dist/toolkits/bitbucket/tools/commits.js +444 -0
- package/dist/toolkits/bitbucket/tools/index.d.ts +1093 -0
- package/dist/toolkits/bitbucket/tools/index.js +770 -0
- package/dist/toolkits/bitbucket/tools/issues.d.ts +73 -0
- package/dist/toolkits/bitbucket/tools/issues.js +234 -0
- package/dist/toolkits/bitbucket/tools/pipelines.d.ts +124 -0
- package/dist/toolkits/bitbucket/tools/pipelines.js +446 -0
- package/dist/toolkits/bitbucket/tools/pull-requests.d.ts +174 -0
- package/dist/toolkits/bitbucket/tools/pull-requests.js +541 -0
- package/dist/toolkits/bitbucket/tools/reports.d.ts +84 -0
- package/dist/toolkits/bitbucket/tools/reports.js +213 -0
- package/dist/toolkits/bitbucket/tools/repositories.d.ts +156 -0
- package/dist/toolkits/bitbucket/tools/repositories.js +531 -0
- package/dist/toolkits/bitbucket/tools/search.d.ts +17 -0
- package/dist/toolkits/bitbucket/tools/search.js +67 -0
- package/dist/toolkits/bitbucket/tools/snippets.d.ts +34 -0
- package/dist/toolkits/bitbucket/tools/snippets.js +122 -0
- package/dist/toolkits/bitbucket/tools/users-workspaces.d.ts +65 -0
- package/dist/toolkits/bitbucket/tools/users-workspaces.js +294 -0
- package/dist/toolkits/discord/icon.d.ts +5 -0
- package/dist/toolkits/discord/icon.js +12 -0
- package/dist/toolkits/discord/manifest.d.ts +3 -0
- package/dist/toolkits/discord/manifest.js +52 -0
- package/dist/toolkits/discord/tools/applications.d.ts +79 -0
- package/dist/toolkits/discord/tools/applications.js +216 -0
- package/dist/toolkits/discord/tools/client.d.ts +22 -0
- package/dist/toolkits/discord/tools/client.js +69 -0
- package/dist/toolkits/discord/tools/guilds.d.ts +39 -0
- package/dist/toolkits/discord/tools/guilds.js +123 -0
- package/dist/toolkits/discord/tools/index.d.ts +222 -0
- package/dist/toolkits/discord/tools/index.js +170 -0
- package/dist/toolkits/discord/tools/misc.d.ts +7 -0
- package/dist/toolkits/discord/tools/misc.js +40 -0
- package/dist/toolkits/discord/tools/users.d.ts +28 -0
- package/dist/toolkits/discord/tools/users.js +128 -0
- package/dist/toolkits/figma/tools/index.d.ts +1 -1
- package/dist/toolkits/figma/tools/render-images-of-file-nodes.d.ts +1 -1
- package/dist/toolkits/gitlab/icon.d.ts +5 -0
- package/dist/toolkits/gitlab/icon.js +6 -0
- package/dist/toolkits/gitlab/manifest.d.ts +3 -0
- package/dist/toolkits/gitlab/manifest.js +36 -0
- package/dist/toolkits/gitlab/tools/client.d.ts +7 -0
- package/dist/toolkits/gitlab/tools/client.js +45 -0
- package/dist/toolkits/gitlab/tools/index.d.ts +306 -0
- package/dist/toolkits/gitlab/tools/index.js +36 -0
- package/dist/toolkits/gitlab/tools/issues.d.ts +45 -0
- package/dist/toolkits/gitlab/tools/issues.js +103 -0
- package/dist/toolkits/gitlab/tools/merge-requests.d.ts +35 -0
- package/dist/toolkits/gitlab/tools/merge-requests.js +91 -0
- package/dist/toolkits/gitlab/tools/pipelines.d.ts +30 -0
- package/dist/toolkits/gitlab/tools/pipelines.js +66 -0
- package/dist/toolkits/gitlab/tools/projects.d.ts +36 -0
- package/dist/toolkits/gitlab/tools/projects.js +94 -0
- package/dist/toolkits/gitlab/tools/repository.d.ts +21 -0
- package/dist/toolkits/gitlab/tools/repository.js +53 -0
- package/dist/toolkits/gitlab/tools/users-groups.d.ts +11 -0
- package/dist/toolkits/gitlab/tools/users-groups.js +30 -0
- package/dist/toolkits/google-ads/tools/get-rmf-report.d.ts +2 -2
- package/dist/toolkits/google-ads/tools/index.d.ts +2 -2
- package/dist/toolkits/google-analytics/icon.d.ts +5 -0
- package/dist/toolkits/google-analytics/icon.js +11 -0
- package/dist/toolkits/google-analytics/manifest.d.ts +3 -0
- package/dist/toolkits/google-analytics/manifest.js +48 -0
- package/dist/toolkits/google-analytics/tools/admin.d.ts +73 -0
- package/dist/toolkits/google-analytics/tools/admin.js +238 -0
- package/dist/toolkits/google-analytics/tools/audiences.d.ts +81 -0
- package/dist/toolkits/google-analytics/tools/audiences.js +190 -0
- package/dist/toolkits/google-analytics/tools/client.d.ts +47 -0
- package/dist/toolkits/google-analytics/tools/client.js +74 -0
- package/dist/toolkits/google-analytics/tools/custom-definitions.d.ts +62 -0
- package/dist/toolkits/google-analytics/tools/custom-definitions.js +106 -0
- package/dist/toolkits/google-analytics/tools/index.d.ts +16 -0
- package/dist/toolkits/google-analytics/tools/index.js +88 -0
- package/dist/toolkits/google-analytics/tools/links.d.ts +22 -0
- package/dist/toolkits/google-analytics/tools/links.js +56 -0
- package/dist/toolkits/google-analytics/tools/measurement.d.ts +3 -0
- package/dist/toolkits/google-analytics/tools/measurement.js +55 -0
- package/dist/toolkits/google-analytics/tools/reports.d.ts +136 -0
- package/dist/toolkits/google-analytics/tools/reports.js +200 -0
- package/dist/toolkits/google-contacts/icon.d.ts +5 -0
- package/dist/toolkits/google-contacts/icon.js +6 -0
- package/dist/toolkits/google-contacts/manifest.d.ts +3 -0
- package/dist/toolkits/google-contacts/manifest.js +48 -0
- package/dist/toolkits/google-contacts/tools/client.d.ts +19 -0
- package/dist/toolkits/google-contacts/tools/client.js +44 -0
- package/dist/toolkits/google-contacts/tools/contacts.d.ts +94 -0
- package/dist/toolkits/google-contacts/tools/contacts.js +273 -0
- package/dist/toolkits/google-contacts/tools/directory.d.ts +36 -0
- package/dist/toolkits/google-contacts/tools/directory.js +99 -0
- package/dist/toolkits/google-contacts/tools/groups.d.ts +68 -0
- package/dist/toolkits/google-contacts/tools/groups.js +169 -0
- package/dist/toolkits/google-contacts/tools/index.d.ts +347 -0
- package/dist/toolkits/google-contacts/tools/index.js +34 -0
- package/dist/toolkits/google-contacts/tools/photos.d.ts +26 -0
- package/dist/toolkits/google-contacts/tools/photos.js +52 -0
- package/dist/toolkits/google-maps/icon.d.ts +5 -0
- package/dist/toolkits/google-maps/icon.js +39 -0
- package/dist/toolkits/google-maps/manifest.d.ts +3 -0
- package/dist/toolkits/google-maps/manifest.js +55 -0
- package/dist/toolkits/google-maps/tools/client.d.ts +27 -0
- package/dist/toolkits/google-maps/tools/client.js +72 -0
- package/dist/toolkits/google-maps/tools/geocode.d.ts +49 -0
- package/dist/toolkits/google-maps/tools/geocode.js +168 -0
- package/dist/toolkits/google-maps/tools/index.d.ts +432 -0
- package/dist/toolkits/google-maps/tools/index.js +31 -0
- package/dist/toolkits/google-maps/tools/misc.d.ts +70 -0
- package/dist/toolkits/google-maps/tools/misc.js +158 -0
- package/dist/toolkits/google-maps/tools/places.d.ts +112 -0
- package/dist/toolkits/google-maps/tools/places.js +185 -0
- package/dist/toolkits/google-maps/tools/routes.d.ts +48 -0
- package/dist/toolkits/google-maps/tools/routes.js +97 -0
- package/dist/toolkits/google-maps/tools/tiles.d.ts +51 -0
- package/dist/toolkits/google-maps/tools/tiles.js +84 -0
- package/dist/toolkits/google-photos/icon.d.ts +5 -0
- package/dist/toolkits/google-photos/icon.js +6 -0
- package/dist/toolkits/google-photos/manifest.d.ts +3 -0
- package/dist/toolkits/google-photos/manifest.js +47 -0
- package/dist/toolkits/google-photos/tools/albums.d.ts +83 -0
- package/dist/toolkits/google-photos/tools/albums.js +180 -0
- package/dist/toolkits/google-photos/tools/client.d.ts +24 -0
- package/dist/toolkits/google-photos/tools/client.js +77 -0
- package/dist/toolkits/google-photos/tools/index.d.ts +261 -0
- package/dist/toolkits/google-photos/tools/index.js +22 -0
- package/dist/toolkits/google-photos/tools/media.d.ts +52 -0
- package/dist/toolkits/google-photos/tools/media.js +142 -0
- package/dist/toolkits/google-photos/tools/uploads.d.ts +58 -0
- package/dist/toolkits/google-photos/tools/uploads.js +107 -0
- package/dist/toolkits/google-tasks/tools/index.d.ts +1 -1
- package/dist/toolkits/google-tasks/tools/update-task-full.d.ts +1 -1
- package/dist/toolkits/groww/tools/index.d.ts +1 -1
- package/dist/toolkits/groww/tools/instruments.d.ts +1 -1
- package/dist/toolkits/reddit/tools/index.d.ts +1 -1
- package/dist/toolkits/reddit/tools/search-across-subreddits.d.ts +1 -1
- package/dist/toolkits/slack/icon.d.ts +5 -0
- package/dist/toolkits/slack/icon.js +20 -0
- package/dist/toolkits/slack/manifest.d.ts +3 -0
- package/dist/toolkits/slack/manifest.js +93 -0
- package/dist/toolkits/slack/tools/admin-apps.d.ts +32 -0
- package/dist/toolkits/slack/tools/admin-apps.js +116 -0
- package/dist/toolkits/slack/tools/admin-conversations.d.ts +62 -0
- package/dist/toolkits/slack/tools/admin-conversations.js +246 -0
- package/dist/toolkits/slack/tools/admin-invites.d.ts +19 -0
- package/dist/toolkits/slack/tools/admin-invites.js +75 -0
- package/dist/toolkits/slack/tools/admin-users.d.ts +52 -0
- package/dist/toolkits/slack/tools/admin-users.js +182 -0
- package/dist/toolkits/slack/tools/audit.d.ts +20 -0
- package/dist/toolkits/slack/tools/audit.js +81 -0
- package/dist/toolkits/slack/tools/calls.d.ts +38 -0
- package/dist/toolkits/slack/tools/calls.js +141 -0
- package/dist/toolkits/slack/tools/canvas.d.ts +24 -0
- package/dist/toolkits/slack/tools/canvas.js +102 -0
- package/dist/toolkits/slack/tools/client.d.ts +22 -0
- package/dist/toolkits/slack/tools/client.js +73 -0
- package/dist/toolkits/slack/tools/conversations.d.ts +131 -0
- package/dist/toolkits/slack/tools/conversations.js +463 -0
- package/dist/toolkits/slack/tools/emoji.d.ts +29 -0
- package/dist/toolkits/slack/tools/emoji.js +118 -0
- package/dist/toolkits/slack/tools/files.d.ts +113 -0
- package/dist/toolkits/slack/tools/files.js +368 -0
- package/dist/toolkits/slack/tools/index.d.ts +28 -0
- package/dist/toolkits/slack/tools/index.js +187 -0
- package/dist/toolkits/slack/tools/messages.d.ts +106 -0
- package/dist/toolkits/slack/tools/messages.js +340 -0
- package/dist/toolkits/slack/tools/misc.d.ts +42 -0
- package/dist/toolkits/slack/tools/misc.js +127 -0
- package/dist/toolkits/slack/tools/reactions-stars-pins.d.ts +69 -0
- package/dist/toolkits/slack/tools/reactions-stars-pins.js +236 -0
- package/dist/toolkits/slack/tools/reminders.d.ts +22 -0
- package/dist/toolkits/slack/tools/reminders.js +83 -0
- package/dist/toolkits/slack/tools/search.d.ts +49 -0
- package/dist/toolkits/slack/tools/search.js +155 -0
- package/dist/toolkits/slack/tools/slack-lists.d.ts +65 -0
- package/dist/toolkits/slack/tools/slack-lists.js +282 -0
- package/dist/toolkits/slack/tools/teams.d.ts +75 -0
- package/dist/toolkits/slack/tools/teams.js +285 -0
- package/dist/toolkits/slack/tools/usergroups.d.ts +56 -0
- package/dist/toolkits/slack/tools/usergroups.js +194 -0
- package/dist/toolkits/slack/tools/users.d.ts +87 -0
- package/dist/toolkits/slack/tools/users.js +396 -0
- package/dist/toolkits/youtube/tools/add-video-to-playlist.d.ts +1 -1
- package/dist/toolkits/youtube/tools/delete-video.d.ts +1 -1
- package/dist/toolkits/youtube/tools/index.d.ts +10 -10
- package/dist/toolkits/youtube/tools/list-caption-track.d.ts +1 -1
- package/dist/toolkits/youtube/tools/list-playlist-items.d.ts +1 -1
- package/dist/toolkits/youtube/tools/list-video-categories.d.ts +1 -1
- package/dist/toolkits/youtube/tools/post-comment.d.ts +1 -1
- package/dist/toolkits/youtube/tools/report-video-abuse.d.ts +1 -1
- package/dist/toolkits/youtube/tools/search-youtube.d.ts +1 -1
- package/dist/toolkits/youtube/tools/update-thumbnail.d.ts +1 -1
- package/dist/toolkits/youtube/tools/update-video.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export declare const bitbucketCreateIssue: import("ai").Tool<{
|
|
2
|
+
title: string;
|
|
3
|
+
content: string;
|
|
4
|
+
repoSlug: string;
|
|
5
|
+
workspace: string;
|
|
6
|
+
priority?: string | undefined;
|
|
7
|
+
assignee?: string | undefined;
|
|
8
|
+
kind?: string | undefined;
|
|
9
|
+
bitbucketToken?: string | undefined;
|
|
10
|
+
dueOn?: string | undefined;
|
|
11
|
+
versionId?: number | undefined;
|
|
12
|
+
componentId?: number | undefined;
|
|
13
|
+
milestoneId?: number | undefined;
|
|
14
|
+
}, any>;
|
|
15
|
+
export declare const bitbucketUpdateIssue: import("ai").Tool<{
|
|
16
|
+
issueId: string;
|
|
17
|
+
repoSlug: string;
|
|
18
|
+
workspace: string;
|
|
19
|
+
title?: string | undefined;
|
|
20
|
+
version?: string | undefined;
|
|
21
|
+
priority?: "critical" | "trivial" | "minor" | "major" | "blocker" | undefined;
|
|
22
|
+
content?: string | undefined;
|
|
23
|
+
state?: "new" | "open" | "closed" | "duplicate" | "resolved" | "on hold" | "invalid" | "wontfix" | undefined;
|
|
24
|
+
milestone?: string | undefined;
|
|
25
|
+
kind?: "task" | "bug" | "enhancement" | "proposal" | undefined;
|
|
26
|
+
bitbucketToken?: string | undefined;
|
|
27
|
+
component?: string | undefined;
|
|
28
|
+
assigneeAccountId?: string | undefined;
|
|
29
|
+
}, any>;
|
|
30
|
+
export declare const bitbucketDeleteIssue: import("ai").Tool<{
|
|
31
|
+
issueId: string;
|
|
32
|
+
repoSlug: string;
|
|
33
|
+
workspace: string;
|
|
34
|
+
bitbucketToken?: string | undefined;
|
|
35
|
+
}, any>;
|
|
36
|
+
export declare const bitbucketListIssues: import("ai").Tool<{
|
|
37
|
+
repoSlug: string;
|
|
38
|
+
workspace: string;
|
|
39
|
+
priority?: string | undefined;
|
|
40
|
+
page?: number | undefined;
|
|
41
|
+
state?: string | undefined;
|
|
42
|
+
assignee?: string | undefined;
|
|
43
|
+
kind?: string | undefined;
|
|
44
|
+
bitbucketToken?: string | undefined;
|
|
45
|
+
pagelen?: number | undefined;
|
|
46
|
+
}, any>;
|
|
47
|
+
export declare const bitbucketCreateIssueComment: import("ai").Tool<{
|
|
48
|
+
issueId: string;
|
|
49
|
+
content: string;
|
|
50
|
+
repoSlug: string;
|
|
51
|
+
workspace: string;
|
|
52
|
+
bitbucketToken?: string | undefined;
|
|
53
|
+
}, any>;
|
|
54
|
+
export declare const bitbucketCheckIssueVote: import("ai").Tool<{
|
|
55
|
+
issueId: number;
|
|
56
|
+
repoSlug: string;
|
|
57
|
+
workspace: string;
|
|
58
|
+
bitbucketToken?: string | undefined;
|
|
59
|
+
}, {
|
|
60
|
+
error: string;
|
|
61
|
+
} | {
|
|
62
|
+
has_voted: boolean;
|
|
63
|
+
}>;
|
|
64
|
+
export declare const bitbucketListVersions: import("ai").Tool<{
|
|
65
|
+
repoSlug: string;
|
|
66
|
+
workspace: string;
|
|
67
|
+
sort?: string | undefined;
|
|
68
|
+
q?: string | undefined;
|
|
69
|
+
page?: number | undefined;
|
|
70
|
+
bitbucketToken?: string | undefined;
|
|
71
|
+
pagelen?: number | undefined;
|
|
72
|
+
}, any>;
|
|
73
|
+
//# sourceMappingURL=issues.d.ts.map
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { tool } from 'ai';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { bbRequest, toBbError, requireToken, enc, nameOrIdRef, BitbucketApiError } from './client.js';
|
|
5
|
+
export const bitbucketCreateIssue = tool({
|
|
6
|
+
description: "Creates a new issue in a Bitbucket repository, setting the authenticated user as reporter; ensures assignee (if provided) has repository access, and that any specified milestone, version, or component IDs exist.",
|
|
7
|
+
inputSchema: z.object({
|
|
8
|
+
bitbucketToken: z.string().optional().describe("Injected by system; do not provide"),
|
|
9
|
+
kind: z.string().optional().describe("Type of the issue (e.g., 'bug', 'enhancement', 'proposal', 'task')."),
|
|
10
|
+
title: z.string().describe("Title for the new issue."),
|
|
11
|
+
dueOn: z.string().optional().describe("Due date for the issue in ISO 8601 format (e.g., 'YYYY-MM-DDTHH:mm:ssZ')."),
|
|
12
|
+
content: z.string().describe("Detailed description for the new issue."),
|
|
13
|
+
assignee: z.string().optional().describe("Bitbucket username of the assignee. The assignee must have repository access."),
|
|
14
|
+
priority: z.string().optional().describe("Priority level of the issue (e.g., 'trivial', 'minor', 'major', 'critical', 'blocker')."),
|
|
15
|
+
repoSlug: z.string().describe("The slug of the Bitbucket repository."),
|
|
16
|
+
workspace: z.string().describe("The ID or slug of the Bitbucket workspace."),
|
|
17
|
+
versionId: z.number().int().optional().describe("Numeric ID of an existing version to associate with this issue."),
|
|
18
|
+
componentId: z.number().int().optional().describe("Numeric ID of an existing component to associate with this issue."),
|
|
19
|
+
milestoneId: z.number().int().optional().describe("Numeric ID of an existing milestone to associate with this issue."),
|
|
20
|
+
}),
|
|
21
|
+
execute: async ({ bitbucketToken, workspace, repoSlug, title, content, kind, dueOn, assignee, priority, versionId, componentId, milestoneId }) => {
|
|
22
|
+
const missing = requireToken(bitbucketToken);
|
|
23
|
+
if (missing)
|
|
24
|
+
return missing;
|
|
25
|
+
try {
|
|
26
|
+
const body = { title, content: { raw: content } };
|
|
27
|
+
if (kind !== undefined)
|
|
28
|
+
body.kind = kind;
|
|
29
|
+
if (priority !== undefined)
|
|
30
|
+
body.priority = priority;
|
|
31
|
+
if (assignee !== undefined)
|
|
32
|
+
body.assignee = { username: assignee };
|
|
33
|
+
if (milestoneId !== undefined)
|
|
34
|
+
body.milestone = nameOrIdRef(milestoneId);
|
|
35
|
+
if (versionId !== undefined)
|
|
36
|
+
body.version = nameOrIdRef(versionId);
|
|
37
|
+
if (componentId !== undefined)
|
|
38
|
+
body.component = nameOrIdRef(componentId);
|
|
39
|
+
return await bbRequest(bitbucketToken, 'POST', `/repositories/${enc(workspace)}/${enc(repoSlug)}/issues`, { body });
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
return toBbError(error, "Failed to create issue");
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
export const bitbucketUpdateIssue = tool({
|
|
47
|
+
description: "Updates an existing issue in a Bitbucket repository by modifying specified attributes; requires `workspace`, `repo_slug`, `issue_id`, and at least one attribute to update.",
|
|
48
|
+
inputSchema: z.object({
|
|
49
|
+
bitbucketToken: z.string().optional().describe("Injected by system; do not provide"),
|
|
50
|
+
kind: z.enum(["bug", "enhancement", "proposal", "task"]).optional().describe("Types/kinds of Bitbucket issues."),
|
|
51
|
+
state: z.enum(["new", "open", "resolved", "on hold", "invalid", "duplicate", "wontfix", "closed"]).optional().describe("States for Bitbucket issues."),
|
|
52
|
+
title: z.string().optional().describe("The new title for the issue. If omitted, the title remains unchanged."),
|
|
53
|
+
content: z.string().optional().describe("The new content or description for the issue, in raw text format. If omitted, the content remains unchanged."),
|
|
54
|
+
version: z.string().optional().describe("The name of the version affected by this issue (e.g., '1.0.0', '2.0-beta'). If omitted, the version remains unchanged."),
|
|
55
|
+
issueId: z.string().describe("The unique identifier (ID) of the issue to be updated."),
|
|
56
|
+
priority: z.enum(["trivial", "minor", "major", "critical", "blocker"]).optional().describe("Priority levels for Bitbucket issues."),
|
|
57
|
+
component: z.string().optional().describe("The name of the component to associate with the issue (e.g., 'API', 'Frontend'). If omitted, the component remains unchanged."),
|
|
58
|
+
milestone: z.string().optional().describe("The name of the milestone to associate with the issue (e.g., 'Sprint 1', 'v1.0 Launch'). If omitted, the milestone remains unchanged."),
|
|
59
|
+
repoSlug: z.string().describe("The slug or name of the repository (e.g., 'my-app-repo')."),
|
|
60
|
+
workspace: z.string().describe("The workspace ID or slug that owns the repository (e.g., 'my-company' or '{123e4567-e89b-12d3-a456-426614174000}')."),
|
|
61
|
+
assigneeAccountId: z.string().optional().describe("The Bitbucket account ID (UUID) of the user to assign the issue to. If omitted, the assignee remains unchanged."),
|
|
62
|
+
}),
|
|
63
|
+
execute: async ({ bitbucketToken, workspace, repoSlug, issueId, kind, state, title, content, version, priority, component, milestone, assigneeAccountId }) => {
|
|
64
|
+
const missing = requireToken(bitbucketToken);
|
|
65
|
+
if (missing)
|
|
66
|
+
return missing;
|
|
67
|
+
try {
|
|
68
|
+
const body = {};
|
|
69
|
+
if (title !== undefined)
|
|
70
|
+
body.title = title;
|
|
71
|
+
if (content !== undefined)
|
|
72
|
+
body.content = { raw: content };
|
|
73
|
+
if (kind !== undefined)
|
|
74
|
+
body.kind = kind;
|
|
75
|
+
if (state !== undefined)
|
|
76
|
+
body.state = state;
|
|
77
|
+
if (priority !== undefined)
|
|
78
|
+
body.priority = priority;
|
|
79
|
+
if (component !== undefined)
|
|
80
|
+
body.component = nameOrIdRef(component);
|
|
81
|
+
if (milestone !== undefined)
|
|
82
|
+
body.milestone = nameOrIdRef(milestone);
|
|
83
|
+
if (version !== undefined)
|
|
84
|
+
body.version = nameOrIdRef(version);
|
|
85
|
+
if (assigneeAccountId !== undefined)
|
|
86
|
+
body.assignee = { account_id: assigneeAccountId };
|
|
87
|
+
return await bbRequest(bitbucketToken, 'PUT', `/repositories/${enc(workspace)}/${enc(repoSlug)}/issues/${enc(issueId)}`, { body });
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
return toBbError(error, "Failed to update issue");
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
export const bitbucketDeleteIssue = tool({
|
|
95
|
+
description: "Permanently deletes a specific issue, identified by its `issue_id`, from the repository specified by `repo_slug` within the given `workspace`.",
|
|
96
|
+
inputSchema: z.object({
|
|
97
|
+
bitbucketToken: z.string().optional().describe("Injected by system; do not provide"),
|
|
98
|
+
issueId: z.string().describe("The unique identifier of the issue to be deleted from the specified repository."),
|
|
99
|
+
repoSlug: z.string().describe("The slug of the repository. This is the repository's name, usually in lowercase and with hyphens instead of spaces."),
|
|
100
|
+
workspace: z.string().describe("The workspace ID (slug) or UUID of the Bitbucket workspace that owns the repository. This can be the workspace name or its universally unique identifier."),
|
|
101
|
+
}),
|
|
102
|
+
execute: async ({ bitbucketToken, workspace, repoSlug, issueId }) => {
|
|
103
|
+
const missing = requireToken(bitbucketToken);
|
|
104
|
+
if (missing)
|
|
105
|
+
return missing;
|
|
106
|
+
try {
|
|
107
|
+
return await bbRequest(bitbucketToken, 'DELETE', `/repositories/${enc(workspace)}/${enc(repoSlug)}/issues/${enc(issueId)}`);
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
return toBbError(error, "Failed to delete issue");
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
export const bitbucketListIssues = tool({
|
|
115
|
+
description: "Lists issues in a Bitbucket repository with optional filtering by state, priority, kind, or assignee. Use when you need to discover issue IDs or get an overview of repository issues.",
|
|
116
|
+
inputSchema: z.object({
|
|
117
|
+
bitbucketToken: z.string().optional().describe("Injected by system; do not provide"),
|
|
118
|
+
kind: z.string().optional().describe("Filter issues by kind (type). Use 'bug', 'enhancement', 'proposal', or 'task'. If not provided, issues of all kinds are returned."),
|
|
119
|
+
page: z.number().int().min(1).optional().describe("Page number for paginated results (starts from 1)."),
|
|
120
|
+
state: z.string().optional().describe("Filter issues by state. Use a specific state like 'new', 'open', 'resolved', 'on hold', 'invalid', 'duplicate', 'wontfix', or 'closed'. If not provided, all issues regardless of state are returned."),
|
|
121
|
+
pagelen: z.number().int().min(1).max(100).optional().describe("Number of issues per page (1-100). Bitbucket default is 10 if not specified."),
|
|
122
|
+
assignee: z.string().optional().describe("Filter issues by assignee. Provide the Bitbucket account ID (UUID) of the assignee. Use 'null' (as a string) to find unassigned issues. If not provided, issues with any assignee (or no assignee) are returned."),
|
|
123
|
+
priority: z.string().optional().describe("Filter issues by priority. Use 'trivial', 'minor', 'major', 'critical', or 'blocker'. If not provided, issues of all priorities are returned."),
|
|
124
|
+
repoSlug: z.string().describe("The slug (URL-friendly name) of the repository."),
|
|
125
|
+
workspace: z.string().describe("The workspace ID or slug (URL-friendly name) that owns the repository."),
|
|
126
|
+
}),
|
|
127
|
+
execute: async ({ bitbucketToken, workspace, repoSlug, kind, page, state, pagelen, assignee, priority }) => {
|
|
128
|
+
const missing = requireToken(bitbucketToken);
|
|
129
|
+
if (missing)
|
|
130
|
+
return missing;
|
|
131
|
+
try {
|
|
132
|
+
const query = {};
|
|
133
|
+
if (state !== undefined)
|
|
134
|
+
query["state"] = state;
|
|
135
|
+
if (kind !== undefined)
|
|
136
|
+
query["kind"] = kind;
|
|
137
|
+
if (priority !== undefined)
|
|
138
|
+
query["priority"] = priority;
|
|
139
|
+
if (assignee !== undefined)
|
|
140
|
+
query["assignee"] = assignee;
|
|
141
|
+
if (page !== undefined)
|
|
142
|
+
query["page"] = page;
|
|
143
|
+
if (pagelen !== undefined)
|
|
144
|
+
query["pagelen"] = pagelen;
|
|
145
|
+
return await bbRequest(bitbucketToken, 'GET', `/repositories/${enc(workspace)}/${enc(repoSlug)}/issues`, { query });
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
return toBbError(error, "Failed to list issues");
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
export const bitbucketCreateIssueComment = tool({
|
|
153
|
+
description: "Adds a new comment with markdown support to an existing Bitbucket issue.",
|
|
154
|
+
inputSchema: z.object({
|
|
155
|
+
bitbucketToken: z.string().optional().describe("Injected by system; do not provide"),
|
|
156
|
+
content: z.string().describe("The raw text content for the comment. This content supports markdown formatting, which Bitbucket will then render."),
|
|
157
|
+
issueId: z.string().describe("The unique identifier of the issue on which the comment will be posted."),
|
|
158
|
+
repoSlug: z.string().describe("The slug (URL-friendly version) of the repository name."),
|
|
159
|
+
workspace: z.string().describe("The ID or slug of the workspace or user that owns the repository."),
|
|
160
|
+
}),
|
|
161
|
+
execute: async ({ bitbucketToken, workspace, repoSlug, issueId, content }) => {
|
|
162
|
+
const missing = requireToken(bitbucketToken);
|
|
163
|
+
if (missing)
|
|
164
|
+
return missing;
|
|
165
|
+
try {
|
|
166
|
+
const body = { content: { raw: content } };
|
|
167
|
+
return await bbRequest(bitbucketToken, 'POST', `/repositories/${enc(workspace)}/${enc(repoSlug)}/issues/${enc(issueId)}/comments`, { body });
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
return toBbError(error, "Failed to create issue comment");
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
export const bitbucketCheckIssueVote = tool({
|
|
175
|
+
description: "Tool to check whether the authenticated user has voted for a specific issue in a Bitbucket repository. Use when you need to verify if the current user has already voted on an issue before attempting to vote or unvote.",
|
|
176
|
+
inputSchema: z.object({
|
|
177
|
+
bitbucketToken: z.string().optional().describe("Injected by system; do not provide"),
|
|
178
|
+
issueId: z.number().int().describe("The numeric ID of the issue to check vote status for."),
|
|
179
|
+
repoSlug: z.string().describe("The slug (URL-friendly name) of the repository."),
|
|
180
|
+
workspace: z.string().describe("The workspace ID or slug (URL-friendly name) that owns the repository."),
|
|
181
|
+
}),
|
|
182
|
+
execute: async ({ bitbucketToken, workspace, repoSlug, issueId }) => {
|
|
183
|
+
const missing = requireToken(bitbucketToken);
|
|
184
|
+
if (missing)
|
|
185
|
+
return missing;
|
|
186
|
+
try {
|
|
187
|
+
try {
|
|
188
|
+
await bbRequest(bitbucketToken, 'GET', `/repositories/${enc(workspace)}/${enc(repoSlug)}/issues/${enc(issueId)}/vote`);
|
|
189
|
+
return { has_voted: true };
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
if (error instanceof BitbucketApiError && error.status === 404)
|
|
193
|
+
return { has_voted: false };
|
|
194
|
+
return toBbError(error, 'Failed to check issue vote');
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
return toBbError(error, "Failed to check issue vote");
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
export const bitbucketListVersions = tool({
|
|
203
|
+
description: "Lists versions (milestones) in a Bitbucket repository's issue tracker. Use when you need to discover available versions for associating with issues, or to retrieve version IDs for use with create_issue.",
|
|
204
|
+
inputSchema: z.object({
|
|
205
|
+
bitbucketToken: z.string().optional().describe("Injected by system; do not provide"),
|
|
206
|
+
q: z.string().optional().describe("Query string using Bitbucket Query Language (BBQL) to filter versions. Syntax: 'field operator value'. Operators: '=' (exact match), '~' (contains substring), '!=' (not equal). String values MUST be enclosed in double quotes. Common use case: filter by version name pattern using 'name~\"pattern\"'. Examples: 'name~\"1.\"' (versions starting with 1.), 'name=\"2.0\"' (exact match for version 2.0)."),
|
|
207
|
+
page: z.number().int().min(1).optional().describe("Page number for paginated results (starts from 1)."),
|
|
208
|
+
sort: z.string().optional().describe("Field for sorting version results. Prefix with '-' for descending order. Common sortable fields: 'name'. Default sorting applies natural sorting."),
|
|
209
|
+
pagelen: z.number().int().min(1).max(100).optional().describe("Number of versions per page (1-100). Bitbucket default is typically 10 if not specified."),
|
|
210
|
+
repoSlug: z.string().describe("The slug or UUID of the repository. This is usually the repository's name in URL-friendly format."),
|
|
211
|
+
workspace: z.string().describe("The workspace ID or slug that owns the repository. This can typically be found in the URL of your Bitbucket workspace."),
|
|
212
|
+
}),
|
|
213
|
+
execute: async ({ bitbucketToken, workspace, repoSlug, q, page, sort, pagelen }) => {
|
|
214
|
+
const missing = requireToken(bitbucketToken);
|
|
215
|
+
if (missing)
|
|
216
|
+
return missing;
|
|
217
|
+
try {
|
|
218
|
+
const query = {};
|
|
219
|
+
if (q !== undefined)
|
|
220
|
+
query["q"] = q;
|
|
221
|
+
if (page !== undefined)
|
|
222
|
+
query["page"] = page;
|
|
223
|
+
if (sort !== undefined)
|
|
224
|
+
query["sort"] = sort;
|
|
225
|
+
if (pagelen !== undefined)
|
|
226
|
+
query["pagelen"] = pagelen;
|
|
227
|
+
return await bbRequest(bitbucketToken, 'GET', `/repositories/${enc(workspace)}/${enc(repoSlug)}/versions`, { query });
|
|
228
|
+
}
|
|
229
|
+
catch (error) {
|
|
230
|
+
return toBbError(error, "Failed to list versions");
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
//# sourceMappingURL=issues.js.map
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
export declare const bitbucketListPipelines: import("ai").Tool<{
|
|
2
|
+
repoSlug: string;
|
|
3
|
+
workspace: string;
|
|
4
|
+
page?: number | undefined;
|
|
5
|
+
bitbucketToken?: string | undefined;
|
|
6
|
+
pagelen?: number | undefined;
|
|
7
|
+
}, any>;
|
|
8
|
+
export declare const bitbucketGetPipeline: import("ai").Tool<{
|
|
9
|
+
repoSlug: string;
|
|
10
|
+
workspace: string;
|
|
11
|
+
pipelineUuid: string;
|
|
12
|
+
bitbucketToken?: string | undefined;
|
|
13
|
+
}, any>;
|
|
14
|
+
export declare const bitbucketListPipelineSteps: import("ai").Tool<{
|
|
15
|
+
repoSlug: string;
|
|
16
|
+
workspace: string;
|
|
17
|
+
pipelineUuid: string;
|
|
18
|
+
bitbucketToken?: string | undefined;
|
|
19
|
+
}, any>;
|
|
20
|
+
export declare const bitbucketStopPipeline: import("ai").Tool<{
|
|
21
|
+
repoSlug: string;
|
|
22
|
+
workspace: string;
|
|
23
|
+
pipelineUuid: string;
|
|
24
|
+
bitbucketToken?: string | undefined;
|
|
25
|
+
}, any>;
|
|
26
|
+
export declare const bitbucketListPipelineSchedules: import("ai").Tool<{
|
|
27
|
+
repoSlug: string;
|
|
28
|
+
workspace: string;
|
|
29
|
+
bitbucketToken?: string | undefined;
|
|
30
|
+
}, any>;
|
|
31
|
+
export declare const bitbucketListPipelineCaches: import("ai").Tool<{
|
|
32
|
+
repoSlug: string;
|
|
33
|
+
workspace: string;
|
|
34
|
+
bitbucketToken?: string | undefined;
|
|
35
|
+
}, any>;
|
|
36
|
+
export declare const bitbucketListPipelineRunners: import("ai").Tool<{
|
|
37
|
+
repoSlug: string;
|
|
38
|
+
workspace: string;
|
|
39
|
+
bitbucketToken?: string | undefined;
|
|
40
|
+
}, any>;
|
|
41
|
+
export declare const bitbucketListPipelineSshKnownHosts: import("ai").Tool<{
|
|
42
|
+
repoSlug: string;
|
|
43
|
+
workspace: string;
|
|
44
|
+
bitbucketToken?: string | undefined;
|
|
45
|
+
}, any>;
|
|
46
|
+
export declare const bitbucketListRepositoryPipelineVariables: import("ai").Tool<{
|
|
47
|
+
repoSlug: string;
|
|
48
|
+
workspace: string;
|
|
49
|
+
sort?: string | undefined;
|
|
50
|
+
q?: string | undefined;
|
|
51
|
+
page?: number | undefined;
|
|
52
|
+
bitbucketToken?: string | undefined;
|
|
53
|
+
pagelen?: number | undefined;
|
|
54
|
+
}, any>;
|
|
55
|
+
export declare const bitbucketCreateTeamPipelineVariable: import("ai").Tool<{
|
|
56
|
+
value: string;
|
|
57
|
+
username: string;
|
|
58
|
+
key: string;
|
|
59
|
+
bitbucketToken?: string | undefined;
|
|
60
|
+
secured?: boolean | undefined;
|
|
61
|
+
}, any>;
|
|
62
|
+
export declare const bitbucketUpdateTeamPipelineVariable: import("ai").Tool<{
|
|
63
|
+
value: string;
|
|
64
|
+
username: string;
|
|
65
|
+
key: string;
|
|
66
|
+
variableUuid: string;
|
|
67
|
+
bitbucketToken?: string | undefined;
|
|
68
|
+
secured?: boolean | undefined;
|
|
69
|
+
}, any>;
|
|
70
|
+
export declare const bitbucketCreateUserPipelineVariable: import("ai").Tool<{
|
|
71
|
+
value: string;
|
|
72
|
+
key: string;
|
|
73
|
+
selectedUser: string;
|
|
74
|
+
bitbucketToken?: string | undefined;
|
|
75
|
+
secured?: boolean | undefined;
|
|
76
|
+
}, any>;
|
|
77
|
+
export declare const bitbucketUpdateUserPipelineVariable: import("ai").Tool<{
|
|
78
|
+
selectedUser: string;
|
|
79
|
+
variableUuid: string;
|
|
80
|
+
value?: string | undefined;
|
|
81
|
+
key?: string | undefined;
|
|
82
|
+
bitbucketToken?: string | undefined;
|
|
83
|
+
secured?: boolean | undefined;
|
|
84
|
+
}, any>;
|
|
85
|
+
export declare const bitbucketDeleteUserPipelineVariable: import("ai").Tool<{
|
|
86
|
+
username: string;
|
|
87
|
+
variableUuid: string;
|
|
88
|
+
bitbucketToken?: string | undefined;
|
|
89
|
+
}, any>;
|
|
90
|
+
export declare const bitbucketListDeployments: import("ai").Tool<{
|
|
91
|
+
repoSlug: string;
|
|
92
|
+
workspace: string;
|
|
93
|
+
sort?: string | undefined;
|
|
94
|
+
q?: string | undefined;
|
|
95
|
+
page?: number | undefined;
|
|
96
|
+
bitbucketToken?: string | undefined;
|
|
97
|
+
pagelen?: number | undefined;
|
|
98
|
+
}, any>;
|
|
99
|
+
export declare const bitbucketListRepositoryEnvironments: import("ai").Tool<{
|
|
100
|
+
repoSlug: string;
|
|
101
|
+
workspace: string;
|
|
102
|
+
sort?: string | undefined;
|
|
103
|
+
q?: string | undefined;
|
|
104
|
+
page?: number | undefined;
|
|
105
|
+
bitbucketToken?: string | undefined;
|
|
106
|
+
pagelen?: number | undefined;
|
|
107
|
+
}, any>;
|
|
108
|
+
export declare const bitbucketGetRepositoryEnvironment: import("ai").Tool<{
|
|
109
|
+
repoSlug: string;
|
|
110
|
+
workspace: string;
|
|
111
|
+
environmentUuid: string;
|
|
112
|
+
bitbucketToken?: string | undefined;
|
|
113
|
+
}, any>;
|
|
114
|
+
export declare const bitbucketListDeploymentEnvironmentVariables: import("ai").Tool<{
|
|
115
|
+
repoSlug: string;
|
|
116
|
+
workspace: string;
|
|
117
|
+
environmentUuid: string;
|
|
118
|
+
bitbucketToken?: string | undefined;
|
|
119
|
+
}, any>;
|
|
120
|
+
export declare const bitbucketGetOpenidConfiguration: import("ai").Tool<{
|
|
121
|
+
workspace: string;
|
|
122
|
+
bitbucketToken?: string | undefined;
|
|
123
|
+
}, any>;
|
|
124
|
+
//# sourceMappingURL=pipelines.d.ts.map
|