@rnsk/toolkits 0.0.2 → 0.0.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 (174) hide show
  1. package/README.md +104 -0
  2. package/dist/core/index.d.ts +1 -0
  3. package/dist/core/index.js +1 -0
  4. package/dist/index.d.ts +0 -1
  5. package/dist/index.js +0 -1
  6. package/dist/toolkits/github/tools/Actions/get-workflow-job.d.ts +3 -3
  7. package/dist/toolkits/github/tools/Actions/list-artifacts.d.ts +1 -1
  8. package/dist/toolkits/github/tools/Actions/list-workflow-jobs.d.ts +4 -4
  9. package/dist/toolkits/github/tools/Actions/list-workflow-run-artifacts.d.ts +1 -1
  10. package/dist/toolkits/github/tools/Activity/list-notifications.d.ts +2 -2
  11. package/dist/toolkits/github/tools/Activity/list-public-events.d.ts +1 -1
  12. package/dist/toolkits/github/tools/Activity/list-repo-events.d.ts +1 -1
  13. package/dist/toolkits/github/tools/Activity/list-user-events.d.ts +1 -1
  14. package/dist/toolkits/github/tools/Apps/list-installations.d.ts +1 -1
  15. package/dist/toolkits/github/tools/Checks/create-check-run.d.ts +5 -5
  16. package/dist/toolkits/github/tools/Checks/create-check-suite.d.ts +2 -2
  17. package/dist/toolkits/github/tools/Checks/get-check-run.d.ts +2 -2
  18. package/dist/toolkits/github/tools/Checks/get-check-suite.d.ts +2 -2
  19. package/dist/toolkits/github/tools/Checks/list-check-runs.d.ts +4 -4
  20. package/dist/toolkits/github/tools/Checks/update-check-run.d.ts +4 -4
  21. package/dist/toolkits/github/tools/CodeScanning/list-alerts.d.ts +2 -2
  22. package/dist/toolkits/github/tools/CodeScanning/update-alert.d.ts +1 -1
  23. package/dist/toolkits/github/tools/Collaborators/add-collaborator.d.ts +1 -1
  24. package/dist/toolkits/github/tools/Collaborators/check-collaborator.d.ts +1 -1
  25. package/dist/toolkits/github/tools/Collaborators/list-collaborators.d.ts +1 -1
  26. package/dist/toolkits/github/tools/Collaborators/remove-collaborator.d.ts +1 -1
  27. package/dist/toolkits/github/tools/Commits/compare-commits.d.ts +2 -2
  28. package/dist/toolkits/github/tools/Commits/get-commit.d.ts +2 -2
  29. package/dist/toolkits/github/tools/Commits/list-commits.d.ts +1 -1
  30. package/dist/toolkits/github/tools/Commits/list-pull-requests-associated-with-commit.d.ts +2 -2
  31. package/dist/toolkits/github/tools/Dependabot/list-alerts.d.ts +1 -1
  32. package/dist/toolkits/github/tools/Dependabot/update-alert.d.ts +1 -1
  33. package/dist/toolkits/github/tools/DeployKeys/list-deploy-keys.d.ts +1 -1
  34. package/dist/toolkits/github/tools/Deployments/create-deployment.d.ts +1 -1
  35. package/dist/toolkits/github/tools/Deployments/list-deployments.d.ts +1 -1
  36. package/dist/toolkits/github/tools/Environments/list-environments.d.ts +1 -1
  37. package/dist/toolkits/github/tools/Files/create-or-update-file.d.ts +1 -1
  38. package/dist/toolkits/github/tools/Gists/create-gist.d.ts +1 -1
  39. package/dist/toolkits/github/tools/Git/create-blob.d.ts +1 -1
  40. package/dist/toolkits/github/tools/Git/create-tree.d.ts +1 -1
  41. package/dist/toolkits/github/tools/Issues/add-issue-assignees.d.ts +1 -1
  42. package/dist/toolkits/github/tools/Issues/add-issue-labels.d.ts +1 -1
  43. package/dist/toolkits/github/tools/Issues/list-authenticated-user-issues.d.ts +4 -4
  44. package/dist/toolkits/github/tools/Issues/list-issue-comments.d.ts +1 -1
  45. package/dist/toolkits/github/tools/Issues/list-org-issues.d.ts +4 -4
  46. package/dist/toolkits/github/tools/Issues/list-repo-issues.d.ts +2 -2
  47. package/dist/toolkits/github/tools/Issues/list-user-account-issues.d.ts +4 -4
  48. package/dist/toolkits/github/tools/Organizations/get-org-membership.d.ts +1 -1
  49. package/dist/toolkits/github/tools/Organizations/list-org-members.d.ts +1 -1
  50. package/dist/toolkits/github/tools/Organizations/list-org-repositories.d.ts +2 -2
  51. package/dist/toolkits/github/tools/Organizations/list-user-organizations.d.ts +1 -1
  52. package/dist/toolkits/github/tools/Organizations/update-organization.d.ts +1 -1
  53. package/dist/toolkits/github/tools/PRs/create-pull-request-review.d.ts +1 -1
  54. package/dist/toolkits/github/tools/PRs/list-pull-request-files.d.ts +1 -1
  55. package/dist/toolkits/github/tools/PRs/list-pull-requests.d.ts +1 -1
  56. package/dist/toolkits/github/tools/Projects/list-org-projects.d.ts +1 -1
  57. package/dist/toolkits/github/tools/Projects/list-project-columns.d.ts +1 -1
  58. package/dist/toolkits/github/tools/Projects/list-repo-projects.d.ts +1 -1
  59. package/dist/toolkits/github/tools/Projects/update-project.d.ts +1 -1
  60. package/dist/toolkits/github/tools/Reactions/create-commit-comment-reaction.d.ts +1 -1
  61. package/dist/toolkits/github/tools/Reactions/create-issue-reaction.d.ts +1 -1
  62. package/dist/toolkits/github/tools/Reactions/list-commit-comment-reactions.d.ts +1 -1
  63. package/dist/toolkits/github/tools/Reactions/list-issue-reactions.d.ts +1 -1
  64. package/dist/toolkits/github/tools/Reactions/list-pr-comment-reactions.d.ts +1 -1
  65. package/dist/toolkits/github/tools/Releases/list-releases.d.ts +1 -1
  66. package/dist/toolkits/github/tools/Repos/get-repo-contributors.d.ts +1 -1
  67. package/dist/toolkits/github/tools/Repos/list-branches.d.ts +1 -1
  68. package/dist/toolkits/github/tools/Repos/list-repos.d.ts +2 -2
  69. package/dist/toolkits/github/tools/Repos/watch-repo.d.ts +1 -1
  70. package/dist/toolkits/github/tools/Search/search-repos.d.ts +1 -1
  71. package/dist/toolkits/github/tools/SecretScanning/list-alerts.d.ts +1 -1
  72. package/dist/toolkits/github/tools/SecretScanning/update-alert.d.ts +1 -1
  73. package/dist/toolkits/github/tools/SecurityAdvisories/create-repository-advisory.d.ts +1 -1
  74. package/dist/toolkits/github/tools/SecurityAdvisories/get-repository-advisory.d.ts +1 -1
  75. package/dist/toolkits/github/tools/SecurityAdvisories/list-global-advisories.d.ts +1 -1
  76. package/dist/toolkits/github/tools/SecurityAdvisories/list-repository-advisories.d.ts +2 -2
  77. package/dist/toolkits/github/tools/Stars/list-stargazers.d.ts +1 -1
  78. package/dist/toolkits/github/tools/Stars/list-starred-repos.d.ts +1 -1
  79. package/dist/toolkits/github/tools/Statuses/create-commit-status.d.ts +1 -1
  80. package/dist/toolkits/github/tools/Statuses/list-commit-statuses.d.ts +1 -1
  81. package/dist/toolkits/github/tools/Teams/list-team-members.d.ts +1 -1
  82. package/dist/toolkits/github/tools/Teams/list-team-repos.d.ts +1 -1
  83. package/dist/toolkits/github/tools/Teams/list-teams.d.ts +1 -1
  84. package/dist/toolkits/github/tools/Users/get-user-context.d.ts +1 -1
  85. package/dist/toolkits/github/tools/Users/update-authenticated-user.d.ts +1 -1
  86. package/dist/toolkits/github/tools/Webhooks/create-repo-webhook.d.ts +1 -1
  87. package/dist/toolkits/github/tools/Webhooks/list-repo-webhooks.d.ts +1 -1
  88. package/dist/toolkits/github/tools/Webhooks/update-repo-webhook.d.ts +1 -1
  89. package/dist/toolkits/github/tools/Workflows/list-workflow-runs.d.ts +2 -2
  90. package/dist/toolkits/github/tools/Workflows/list-workflows.d.ts +1 -1
  91. package/dist/toolkits/github/tools/index.d.ts +4859 -175
  92. package/dist/toolkits/github/tools/index.js +342 -342
  93. package/dist/toolkits/gmail/icon.js +14 -14
  94. package/dist/toolkits/gmail/manifest.js +78 -5
  95. package/dist/toolkits/gmail/tools/create-draft.d.ts +34 -0
  96. package/dist/toolkits/gmail/tools/create-draft.js +60 -0
  97. package/dist/toolkits/gmail/tools/delete-draft.d.ts +23 -0
  98. package/dist/toolkits/gmail/tools/delete-draft.js +34 -0
  99. package/dist/toolkits/gmail/tools/get-draft.d.ts +32 -0
  100. package/dist/toolkits/gmail/tools/get-draft.js +36 -0
  101. package/dist/toolkits/gmail/tools/get-message.d.ts +12 -12
  102. package/dist/toolkits/gmail/tools/get-message.js +3 -24
  103. package/dist/toolkits/gmail/tools/get-thread.d.ts +29 -0
  104. package/dist/toolkits/gmail/tools/get-thread.js +39 -0
  105. package/dist/toolkits/gmail/tools/index.d.ts +17 -0
  106. package/dist/toolkits/gmail/tools/index.js +17 -0
  107. package/dist/toolkits/gmail/tools/list-drafts.d.ts +28 -0
  108. package/dist/toolkits/gmail/tools/list-drafts.js +43 -0
  109. package/dist/toolkits/gmail/tools/list-labels.d.ts +20 -0
  110. package/dist/toolkits/gmail/tools/list-labels.js +46 -0
  111. package/dist/toolkits/gmail/tools/list-threads.d.ts +28 -0
  112. package/dist/toolkits/gmail/tools/list-threads.js +43 -0
  113. package/dist/toolkits/gmail/tools/modify-message-labels.d.ts +31 -0
  114. package/dist/toolkits/gmail/tools/modify-message-labels.js +44 -0
  115. package/dist/toolkits/gmail/tools/reply-to-thread.d.ts +33 -0
  116. package/dist/toolkits/gmail/tools/reply-to-thread.js +58 -0
  117. package/dist/toolkits/gmail/tools/send-draft.d.ts +29 -0
  118. package/dist/toolkits/gmail/tools/send-draft.js +41 -0
  119. package/dist/toolkits/gmail/tools/send-message.d.ts +4 -1
  120. package/dist/toolkits/gmail/tools/send-message.js +18 -16
  121. package/dist/toolkits/gmail/tools/trash-message.d.ts +29 -0
  122. package/dist/toolkits/gmail/tools/trash-message.js +37 -0
  123. package/dist/toolkits/gmail/tools/untrash-message.d.ts +29 -0
  124. package/dist/toolkits/gmail/tools/untrash-message.js +37 -0
  125. package/dist/toolkits/gmail/tools/utils.d.ts +41 -0
  126. package/dist/toolkits/gmail/tools/utils.js +97 -0
  127. package/dist/toolkits/google-calendar/manifest.js +1 -1
  128. package/dist/toolkits/google-calendar/tools/delete-event.d.ts +27 -0
  129. package/dist/toolkits/google-calendar/tools/delete-event.js +38 -0
  130. package/dist/toolkits/google-calendar/tools/get-event.d.ts +24 -0
  131. package/dist/toolkits/google-calendar/tools/get-event.js +37 -0
  132. package/dist/toolkits/google-calendar/tools/index.d.ts +181 -3
  133. package/dist/toolkits/google-calendar/tools/index.js +31 -2
  134. package/dist/toolkits/google-calendar/tools/search-events.d.ts +27 -0
  135. package/dist/toolkits/google-calendar/tools/search-events.js +49 -0
  136. package/dist/toolkits/google-calendar/tools/update-event.d.ts +29 -0
  137. package/dist/toolkits/google-calendar/tools/update-event.js +56 -0
  138. package/dist/toolkits/google-sheets/manifest.js +2 -2
  139. package/dist/toolkits/google-sheets/tools/append-values.d.ts +41 -0
  140. package/dist/toolkits/google-sheets/tools/append-values.js +51 -0
  141. package/dist/toolkits/google-sheets/tools/clear-values.d.ts +27 -0
  142. package/dist/toolkits/google-sheets/tools/clear-values.js +41 -0
  143. package/dist/toolkits/google-sheets/tools/create-spreadsheet.d.ts +33 -0
  144. package/dist/toolkits/google-sheets/tools/create-spreadsheet.js +59 -0
  145. package/dist/toolkits/google-sheets/tools/index.d.ts +205 -7
  146. package/dist/toolkits/google-sheets/tools/index.js +39 -4
  147. package/dist/toolkits/google-sheets/tools/update-values.d.ts +38 -0
  148. package/dist/toolkits/google-sheets/tools/update-values.js +50 -0
  149. package/dist/toolkits/linear/manifest.js +35 -0
  150. package/dist/toolkits/linear/tools/add-comment.d.ts +6 -0
  151. package/dist/toolkits/linear/tools/add-comment.js +52 -0
  152. package/dist/toolkits/linear/tools/get-issue.d.ts +6 -0
  153. package/dist/toolkits/linear/tools/get-issue.js +117 -0
  154. package/dist/toolkits/linear/tools/list-projects.d.ts +4 -0
  155. package/dist/toolkits/linear/tools/list-projects.js +46 -0
  156. package/dist/toolkits/linear/tools/list-workflow-states.d.ts +26 -0
  157. package/dist/toolkits/linear/tools/list-workflow-states.js +59 -0
  158. package/dist/toolkits/linear/tools/update-issue.d.ts +11 -0
  159. package/dist/toolkits/linear/tools/update-issue.js +78 -0
  160. package/dist/toolkits/notion/tools/append-block-children.d.ts +1 -1
  161. package/dist/toolkits/notion/tools/index.d.ts +105 -12
  162. package/dist/toolkits/notion/tools/index.js +8 -8
  163. package/dist/toolkits/notion/tools/query-database.d.ts +1 -1
  164. package/package.json +5 -7
  165. package/dist/runtime/credentials.d.ts +0 -28
  166. package/dist/runtime/credentials.js +0 -15
  167. package/dist/runtime/index.d.ts +0 -5
  168. package/dist/runtime/index.js +0 -5
  169. package/dist/runtime/meta-tools.d.ts +0 -101
  170. package/dist/runtime/meta-tools.js +0 -250
  171. package/dist/runtime/registry.d.ts +0 -20
  172. package/dist/runtime/registry.js +0 -35
  173. /package/dist/{runtime → core}/schema-helpers.d.ts +0 -0
  174. /package/dist/{runtime → core}/schema-helpers.js +0 -0
@@ -0,0 +1,52 @@
1
+ import { tool } from 'ai';
2
+ import { z } from 'zod';
3
+ export const linearAddComment = tool({
4
+ description: 'Add a comment to a Linear issue.',
5
+ inputSchema: z.object({
6
+ issueId: z.string().describe('Linear issue UUID'),
7
+ body: z.string().describe('Comment body (markdown supported)'),
8
+ linearToken: z.string().optional().describe('Linear API token (injected by system)'),
9
+ }),
10
+ execute: async ({ issueId, body, linearToken }) => {
11
+ const graphqlQuery = {
12
+ query: `
13
+ mutation CreateComment($input: CommentCreateInput!) {
14
+ commentCreate(input: $input) {
15
+ success
16
+ comment {
17
+ id
18
+ body
19
+ url
20
+ createdAt
21
+ user { id name }
22
+ }
23
+ }
24
+ }
25
+ `,
26
+ variables: {
27
+ input: {
28
+ issueId,
29
+ body,
30
+ },
31
+ },
32
+ };
33
+ const response = await fetch('https://api.linear.app/graphql', {
34
+ method: 'POST',
35
+ headers: {
36
+ 'Content-Type': 'application/json',
37
+ Authorization: `Bearer ${linearToken}`,
38
+ },
39
+ body: JSON.stringify(graphqlQuery),
40
+ });
41
+ if (!response.ok) {
42
+ const error = await response.json();
43
+ return { error: 'Failed to add Linear comment', details: error };
44
+ }
45
+ const data = await response.json();
46
+ if (data.errors?.length) {
47
+ return { error: 'Linear GraphQL error', details: data.errors };
48
+ }
49
+ return data.data.commentCreate;
50
+ },
51
+ });
52
+ //# sourceMappingURL=add-comment.js.map
@@ -0,0 +1,6 @@
1
+ export declare const linearGetIssue: import("ai").Tool<{
2
+ linearToken?: string | undefined;
3
+ issueId?: string | undefined;
4
+ identifier?: string | undefined;
5
+ }, any>;
6
+ //# sourceMappingURL=get-issue.d.ts.map
@@ -0,0 +1,117 @@
1
+ import { tool } from 'ai';
2
+ import { z } from 'zod';
3
+ export const linearGetIssue = tool({
4
+ description: 'Get a single Linear issue by UUID or identifier (e.g. ENG-123). Returns title, description, status, assignee, priority, and URL.',
5
+ inputSchema: z.object({
6
+ issueId: z
7
+ .string()
8
+ .optional()
9
+ .describe('Linear issue UUID. Use linearSearchIssues if you only have a title or keyword.'),
10
+ identifier: z
11
+ .string()
12
+ .optional()
13
+ .describe('Human-readable issue identifier, e.g. ENG-123 (team key + number).'),
14
+ linearToken: z.string().optional().describe('Linear API token (injected by system)'),
15
+ }),
16
+ execute: async ({ issueId, identifier, linearToken }) => {
17
+ if (!issueId && !identifier) {
18
+ return { error: 'Provide either issueId (UUID) or identifier (e.g. ENG-123).' };
19
+ }
20
+ if (issueId) {
21
+ const graphqlQuery = {
22
+ query: `
23
+ query GetIssue($id: String!) {
24
+ issue(id: $id) {
25
+ id
26
+ identifier
27
+ title
28
+ description
29
+ priority
30
+ url
31
+ createdAt
32
+ updatedAt
33
+ state { id name type }
34
+ assignee { id name email }
35
+ team { id name key }
36
+ project { id name }
37
+ labels { nodes { id name color } }
38
+ }
39
+ }
40
+ `,
41
+ variables: { id: issueId },
42
+ };
43
+ const response = await fetch('https://api.linear.app/graphql', {
44
+ method: 'POST',
45
+ headers: {
46
+ 'Content-Type': 'application/json',
47
+ Authorization: `Bearer ${linearToken}`,
48
+ },
49
+ body: JSON.stringify(graphqlQuery),
50
+ });
51
+ if (!response.ok) {
52
+ const error = await response.json();
53
+ return { error: 'Failed to get Linear issue', details: error };
54
+ }
55
+ const data = await response.json();
56
+ if (data.errors?.length) {
57
+ return { error: 'Linear GraphQL error', details: data.errors };
58
+ }
59
+ return data.data.issue;
60
+ }
61
+ const match = identifier.match(/^([A-Za-z]+)-(\d+)$/);
62
+ if (!match) {
63
+ return { error: 'identifier must look like TEAM-123 (team key and issue number).' };
64
+ }
65
+ const [, teamKey, numberStr] = match;
66
+ const number = Number(numberStr);
67
+ const graphqlQuery = {
68
+ query: `
69
+ query IssueByIdentifier($teamKey: String!, $number: Float!) {
70
+ issues(filter: {
71
+ team: { key: { eq: $teamKey } }
72
+ number: { eq: $number }
73
+ }, first: 1) {
74
+ nodes {
75
+ id
76
+ identifier
77
+ title
78
+ description
79
+ priority
80
+ url
81
+ createdAt
82
+ updatedAt
83
+ state { id name type }
84
+ assignee { id name email }
85
+ team { id name key }
86
+ project { id name }
87
+ labels { nodes { id name color } }
88
+ }
89
+ }
90
+ }
91
+ `,
92
+ variables: { teamKey, number },
93
+ };
94
+ const response = await fetch('https://api.linear.app/graphql', {
95
+ method: 'POST',
96
+ headers: {
97
+ 'Content-Type': 'application/json',
98
+ Authorization: `Bearer ${linearToken}`,
99
+ },
100
+ body: JSON.stringify(graphqlQuery),
101
+ });
102
+ if (!response.ok) {
103
+ const error = await response.json();
104
+ return { error: 'Failed to get Linear issue', details: error };
105
+ }
106
+ const data = await response.json();
107
+ if (data.errors?.length) {
108
+ return { error: 'Linear GraphQL error', details: data.errors };
109
+ }
110
+ const issue = data.data.issues.nodes[0];
111
+ if (!issue) {
112
+ return { error: `No issue found for identifier ${identifier}` };
113
+ }
114
+ return issue;
115
+ },
116
+ });
117
+ //# sourceMappingURL=get-issue.js.map
@@ -0,0 +1,4 @@
1
+ export declare const linearListProjects: import("ai").Tool<{
2
+ linearToken?: string | undefined;
3
+ }, any>;
4
+ //# sourceMappingURL=list-projects.d.ts.map
@@ -0,0 +1,46 @@
1
+ import { tool } from 'ai';
2
+ import { z } from 'zod';
3
+ export const linearListProjects = tool({
4
+ description: 'List Linear projects. Returns project IDs, names, status, and associated teams.',
5
+ inputSchema: z.object({
6
+ linearToken: z.string().optional().describe('Linear API token (injected by system)'),
7
+ }),
8
+ execute: async ({ linearToken }) => {
9
+ const graphqlQuery = {
10
+ query: `
11
+ query {
12
+ projects(first: 50) {
13
+ nodes {
14
+ id
15
+ name
16
+ description
17
+ state
18
+ url
19
+ startDate
20
+ targetDate
21
+ teams { nodes { id name key } }
22
+ }
23
+ }
24
+ }
25
+ `,
26
+ };
27
+ const response = await fetch('https://api.linear.app/graphql', {
28
+ method: 'POST',
29
+ headers: {
30
+ 'Content-Type': 'application/json',
31
+ Authorization: `Bearer ${linearToken}`,
32
+ },
33
+ body: JSON.stringify(graphqlQuery),
34
+ });
35
+ if (!response.ok) {
36
+ const error = await response.json();
37
+ return { error: 'Failed to list Linear projects', details: error };
38
+ }
39
+ const data = await response.json();
40
+ if (data.errors?.length) {
41
+ return { error: 'Linear GraphQL error', details: data.errors };
42
+ }
43
+ return data.data.projects.nodes;
44
+ },
45
+ });
46
+ //# sourceMappingURL=list-projects.js.map
@@ -0,0 +1,26 @@
1
+ export declare const linearListWorkflowStates: import("ai").Tool<{
2
+ teamId: string;
3
+ linearToken?: string | undefined;
4
+ }, {
5
+ error: string;
6
+ details: any;
7
+ teamId?: undefined;
8
+ teamName?: undefined;
9
+ teamKey?: undefined;
10
+ states?: undefined;
11
+ } | {
12
+ error: string;
13
+ details?: undefined;
14
+ teamId?: undefined;
15
+ teamName?: undefined;
16
+ teamKey?: undefined;
17
+ states?: undefined;
18
+ } | {
19
+ teamId: any;
20
+ teamName: any;
21
+ teamKey: any;
22
+ states: any;
23
+ error?: undefined;
24
+ details?: undefined;
25
+ }>;
26
+ //# sourceMappingURL=list-workflow-states.d.ts.map
@@ -0,0 +1,59 @@
1
+ import { tool } from 'ai';
2
+ import { z } from 'zod';
3
+ export const linearListWorkflowStates = tool({
4
+ description: 'List workflow states (statuses) for a Linear team. Use state IDs with linearUpdateIssue to move issues (e.g. Todo → In Progress → Done).',
5
+ inputSchema: z.object({
6
+ teamId: z.string().describe('Team UUID. Use linearListTeams to find team IDs.'),
7
+ linearToken: z.string().optional().describe('Linear API token (injected by system)'),
8
+ }),
9
+ execute: async ({ teamId, linearToken }) => {
10
+ const graphqlQuery = {
11
+ query: `
12
+ query TeamWorkflowStates($teamId: String!) {
13
+ team(id: $teamId) {
14
+ id
15
+ name
16
+ key
17
+ states {
18
+ nodes {
19
+ id
20
+ name
21
+ type
22
+ color
23
+ position
24
+ }
25
+ }
26
+ }
27
+ }
28
+ `,
29
+ variables: { teamId },
30
+ };
31
+ const response = await fetch('https://api.linear.app/graphql', {
32
+ method: 'POST',
33
+ headers: {
34
+ 'Content-Type': 'application/json',
35
+ Authorization: `Bearer ${linearToken}`,
36
+ },
37
+ body: JSON.stringify(graphqlQuery),
38
+ });
39
+ if (!response.ok) {
40
+ const error = await response.json();
41
+ return { error: 'Failed to list Linear workflow states', details: error };
42
+ }
43
+ const data = await response.json();
44
+ if (data.errors?.length) {
45
+ return { error: 'Linear GraphQL error', details: data.errors };
46
+ }
47
+ const team = data.data.team;
48
+ if (!team) {
49
+ return { error: `Team not found: ${teamId}` };
50
+ }
51
+ return {
52
+ teamId: team.id,
53
+ teamName: team.name,
54
+ teamKey: team.key,
55
+ states: team.states.nodes,
56
+ };
57
+ },
58
+ });
59
+ //# sourceMappingURL=list-workflow-states.js.map
@@ -0,0 +1,11 @@
1
+ export declare const linearUpdateIssue: import("ai").Tool<{
2
+ issueId: string;
3
+ description?: string | undefined;
4
+ title?: string | undefined;
5
+ linearToken?: string | undefined;
6
+ stateId?: string | undefined;
7
+ assigneeId?: string | null | undefined;
8
+ priority?: number | undefined;
9
+ projectId?: string | undefined;
10
+ }, any>;
11
+ //# sourceMappingURL=update-issue.d.ts.map
@@ -0,0 +1,78 @@
1
+ import { tool } from 'ai';
2
+ import { z } from 'zod';
3
+ export const linearUpdateIssue = tool({
4
+ description: 'Update a Linear issue. Change title, description, status (stateId), assignee, priority, or project. Use linearListWorkflowStates to find state IDs.',
5
+ inputSchema: z.object({
6
+ issueId: z.string().describe('Linear issue UUID'),
7
+ title: z.string().optional().describe('New title'),
8
+ description: z.string().optional().describe('New description (markdown supported)'),
9
+ stateId: z.string().optional().describe('Workflow state ID (e.g. move to Done). Use linearListWorkflowStates.'),
10
+ assigneeId: z.string().nullable().optional().describe('User ID to assign, or null to unassign.'),
11
+ priority: z
12
+ .number()
13
+ .int()
14
+ .min(0)
15
+ .max(4)
16
+ .optional()
17
+ .describe('Priority: 0=none, 1=urgent, 2=high, 3=medium, 4=low'),
18
+ projectId: z.string().optional().describe('Project ID to associate the issue with'),
19
+ linearToken: z.string().optional().describe('Linear API token (injected by system)'),
20
+ }),
21
+ execute: async ({ issueId, title, description, stateId, assigneeId, priority, projectId, linearToken }) => {
22
+ const input = {};
23
+ if (title !== undefined)
24
+ input.title = title;
25
+ if (description !== undefined)
26
+ input.description = description;
27
+ if (stateId !== undefined)
28
+ input.stateId = stateId;
29
+ if (assigneeId !== undefined)
30
+ input.assigneeId = assigneeId;
31
+ if (priority !== undefined)
32
+ input.priority = priority;
33
+ if (projectId !== undefined)
34
+ input.projectId = projectId;
35
+ if (Object.keys(input).length === 0) {
36
+ return { error: 'Provide at least one field to update (title, description, stateId, assigneeId, priority, or projectId).' };
37
+ }
38
+ const graphqlQuery = {
39
+ query: `
40
+ mutation UpdateIssue($id: String!, $input: IssueUpdateInput!) {
41
+ issueUpdate(id: $id, input: $input) {
42
+ success
43
+ issue {
44
+ id
45
+ identifier
46
+ title
47
+ description
48
+ priority
49
+ url
50
+ state { id name }
51
+ assignee { id name }
52
+ project { id name }
53
+ }
54
+ }
55
+ }
56
+ `,
57
+ variables: { id: issueId, input },
58
+ };
59
+ const response = await fetch('https://api.linear.app/graphql', {
60
+ method: 'POST',
61
+ headers: {
62
+ 'Content-Type': 'application/json',
63
+ Authorization: `Bearer ${linearToken}`,
64
+ },
65
+ body: JSON.stringify(graphqlQuery),
66
+ });
67
+ if (!response.ok) {
68
+ const error = await response.json();
69
+ return { error: 'Failed to update Linear issue', details: error };
70
+ }
71
+ const data = await response.json();
72
+ if (data.errors?.length) {
73
+ return { error: 'Linear GraphQL error', details: data.errors };
74
+ }
75
+ return data.data.issueUpdate;
76
+ },
77
+ });
78
+ //# sourceMappingURL=update-issue.js.map
@@ -1,6 +1,6 @@
1
1
  export declare const notionAppendBlockChildren: import("ai").Tool<{
2
- block_id: string;
3
2
  children: any[];
3
+ block_id: string;
4
4
  notionToken?: string | undefined;
5
5
  }, any>;
6
6
  //# sourceMappingURL=append-block-children.d.ts.map
@@ -1,16 +1,109 @@
1
- import { notionSearch } from './search';
2
- import { notionListDatabases } from './list-databases';
3
- import { notionQueryDatabase } from './query-database';
4
- import { notionGetPage } from './get-page';
5
- import { notionCreatePage } from './create-page';
6
- import { notionUpdatePage } from './update-page';
7
- import { notionAppendBlockChildren } from './append-block-children';
8
- import { notionGetDatabase } from './get-database';
1
+ import { notionSearch } from './search.js';
2
+ import { notionListDatabases } from './list-databases.js';
3
+ import { notionQueryDatabase } from './query-database.js';
4
+ import { notionGetPage } from './get-page.js';
5
+ import { notionCreatePage } from './create-page.js';
6
+ import { notionUpdatePage } from './update-page.js';
7
+ import { notionAppendBlockChildren } from './append-block-children.js';
8
+ import { notionGetDatabase } from './get-database.js';
9
9
  export { notionSearch, notionListDatabases, notionQueryDatabase, notionGetPage, notionCreatePage, notionUpdatePage, notionAppendBlockChildren, notionGetDatabase, };
10
- export declare const notionTools: {
10
+ export declare const notionTools: ({
11
11
  name: string;
12
- description: any;
13
- tool: any;
12
+ description: string;
13
+ tool: import("ai").Tool<{
14
+ query: string;
15
+ page_size: number;
16
+ sort?: {
17
+ direction?: "ascending" | "descending" | undefined;
18
+ timestamp?: "last_edited_time" | undefined;
19
+ } | undefined;
20
+ filter?: {
21
+ value?: "page" | "database" | undefined;
22
+ property?: "object" | undefined;
23
+ } | undefined;
24
+ notionToken?: string | undefined;
25
+ }, any>;
14
26
  requiredAuth: "notionToken";
15
- }[];
27
+ } | {
28
+ name: string;
29
+ description: string;
30
+ tool: import("ai").Tool<{
31
+ page_size: number;
32
+ notionToken?: string | undefined;
33
+ }, any>;
34
+ requiredAuth: "notionToken";
35
+ } | {
36
+ name: string;
37
+ description: string;
38
+ tool: import("ai").Tool<{
39
+ page_size: number;
40
+ database_id: string;
41
+ filter?: any;
42
+ notionToken?: string | undefined;
43
+ sorts?: any[] | undefined;
44
+ }, any>;
45
+ requiredAuth: "notionToken";
46
+ } | {
47
+ name: string;
48
+ description: string;
49
+ tool: import("ai").Tool<{
50
+ page_id: string;
51
+ notionToken?: string | undefined;
52
+ }, {
53
+ error: string;
54
+ details: any;
55
+ page?: undefined;
56
+ content?: undefined;
57
+ } | {
58
+ page: any;
59
+ content: any;
60
+ error?: undefined;
61
+ details?: undefined;
62
+ }>;
63
+ requiredAuth: "notionToken";
64
+ } | {
65
+ name: string;
66
+ description: string;
67
+ tool: import("ai").Tool<{
68
+ parent: {
69
+ database_id?: string | undefined;
70
+ page_id?: string | undefined;
71
+ };
72
+ notionToken?: string | undefined;
73
+ properties?: any;
74
+ children?: any[] | undefined;
75
+ icon?: any;
76
+ cover?: any;
77
+ }, any>;
78
+ requiredAuth: "notionToken";
79
+ } | {
80
+ name: string;
81
+ description: string;
82
+ tool: import("ai").Tool<{
83
+ page_id: string;
84
+ notionToken?: string | undefined;
85
+ properties?: any;
86
+ icon?: any;
87
+ cover?: any;
88
+ archived?: boolean | undefined;
89
+ }, any>;
90
+ requiredAuth: "notionToken";
91
+ } | {
92
+ name: string;
93
+ description: string;
94
+ tool: import("ai").Tool<{
95
+ children: any[];
96
+ block_id: string;
97
+ notionToken?: string | undefined;
98
+ }, any>;
99
+ requiredAuth: "notionToken";
100
+ } | {
101
+ name: string;
102
+ description: string;
103
+ tool: import("ai").Tool<{
104
+ database_id: string;
105
+ notionToken?: string | undefined;
106
+ }, any>;
107
+ requiredAuth: "notionToken";
108
+ })[];
16
109
  //# sourceMappingURL=index.d.ts.map
@@ -1,12 +1,12 @@
1
1
  // @ts-nocheck
2
- import { notionSearch } from './search';
3
- import { notionListDatabases } from './list-databases';
4
- import { notionQueryDatabase } from './query-database';
5
- import { notionGetPage } from './get-page';
6
- import { notionCreatePage } from './create-page';
7
- import { notionUpdatePage } from './update-page';
8
- import { notionAppendBlockChildren } from './append-block-children';
9
- import { notionGetDatabase } from './get-database';
2
+ import { notionSearch } from './search.js';
3
+ import { notionListDatabases } from './list-databases.js';
4
+ import { notionQueryDatabase } from './query-database.js';
5
+ import { notionGetPage } from './get-page.js';
6
+ import { notionCreatePage } from './create-page.js';
7
+ import { notionUpdatePage } from './update-page.js';
8
+ import { notionAppendBlockChildren } from './append-block-children.js';
9
+ import { notionGetDatabase } from './get-database.js';
10
10
  export { notionSearch, notionListDatabases, notionQueryDatabase, notionGetPage, notionCreatePage, notionUpdatePage, notionAppendBlockChildren, notionGetDatabase, };
11
11
  export const notionTools = [
12
12
  {
@@ -1,6 +1,6 @@
1
1
  export declare const notionQueryDatabase: import("ai").Tool<{
2
- database_id: string;
3
2
  page_size: number;
3
+ database_id: string;
4
4
  filter?: any;
5
5
  notionToken?: string | undefined;
6
6
  sorts?: any[] | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnsk/toolkits",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Runstack toolkit registry — manifest-driven tool definitions for AI agents",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -13,20 +13,18 @@
13
13
  "./core": {
14
14
  "types": "./dist/core/index.d.ts",
15
15
  "import": "./dist/core/index.js"
16
- },
17
- "./runtime": {
18
- "types": "./dist/runtime/index.d.ts",
19
- "import": "./dist/runtime/index.js"
20
16
  }
21
17
  },
22
18
  "files": [
19
+ "README.md",
23
20
  "dist/**/*.js",
24
21
  "dist/**/*.d.ts"
25
22
  ],
26
23
  "scripts": {
27
24
  "gen": "tsx scripts/gen-index.ts",
28
- "validate": "tsx scripts/validate.ts",
29
- "build": "npm run gen && tsc",
25
+ "validate": "tsx scripts/validate.ts && tsx scripts/validate-esm.ts --source",
26
+ "validate:dist": "tsx scripts/validate-esm.ts --dist",
27
+ "build": "npm run gen && tsc && npm run validate:dist",
30
28
  "prepublishOnly": "npm run validate && npm run build"
31
29
  },
32
30
  "peerDependencies": {
@@ -1,28 +0,0 @@
1
- import type { ToolkitManifest } from '../core/types.js';
2
- import type { ToolRegistry } from './registry.js';
3
- export interface CredentialResolver {
4
- getToken: (tokenField: string) => Promise<string | null>;
5
- getServiceEnv: (envName: string) => string | undefined;
6
- }
7
- export interface MetaToolPolicyResult {
8
- allowed: boolean;
9
- error?: string;
10
- reason?: string;
11
- }
12
- export interface MetaToolHooks {
13
- checkToolPolicy?: (toolName: string) => MetaToolPolicyResult;
14
- sanitizeToolResult?: (result: unknown) => unknown;
15
- sanitizeToolPayload?: (payload: Record<string, unknown>) => Record<string, unknown>;
16
- isWebSearchEnabled?: () => boolean;
17
- getAppUrl?: () => string;
18
- getProviderSlugs?: () => string[];
19
- isToolkitAvailable?: (toolkitId: string) => {
20
- available: boolean;
21
- reason?: string;
22
- };
23
- }
24
- export declare function registerAllToolsFromManifests(registry: ToolRegistry, manifests: ToolkitManifest[], options?: {
25
- skipUnavailable?: boolean;
26
- isToolkitAvailable?: (id: string) => boolean;
27
- }): void;
28
- //# sourceMappingURL=credentials.d.ts.map
@@ -1,15 +0,0 @@
1
- export function registerAllToolsFromManifests(registry, manifests, options) {
2
- for (const manifest of manifests) {
3
- if (options?.skipUnavailable && options.isToolkitAvailable && !options.isToolkitAvailable(manifest.id)) {
4
- continue;
5
- }
6
- for (const toolDef of manifest.tools) {
7
- registry.register(toolDef.name, toolDef.description ?? toolDef.tool.description ?? '', toolDef.tool, {
8
- requiredAuth: toolDef.requiredAuth,
9
- scope: toolDef.scope,
10
- toolkitId: manifest.id,
11
- });
12
- }
13
- }
14
- }
15
- //# sourceMappingURL=credentials.js.map
@@ -1,5 +0,0 @@
1
- export { getToolInputZodSchema, resolveZodObjectShape, toolInputToJsonSchema, extractParameterInfo, coerceArguments, TOOL_OUTPUT_JSON_SCHEMA, type ParameterInfo, } from './schema-helpers.js';
2
- export { createToolRegistry, type ToolRegistry, type ToolRegistryEntry } from './registry.js';
3
- export { registerAllToolsFromManifests, type CredentialResolver, type MetaToolHooks, type MetaToolPolicyResult, } from './credentials.js';
4
- export { createMetaTools } from './meta-tools.js';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1,5 +0,0 @@
1
- export { getToolInputZodSchema, resolveZodObjectShape, toolInputToJsonSchema, extractParameterInfo, coerceArguments, TOOL_OUTPUT_JSON_SCHEMA, } from './schema-helpers.js';
2
- export { createToolRegistry } from './registry.js';
3
- export { registerAllToolsFromManifests, } from './credentials.js';
4
- export { createMetaTools } from './meta-tools.js';
5
- //# sourceMappingURL=index.js.map