@rnsk/toolkits 0.0.10 → 0.0.11
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 +12 -2
- package/dist/index.d.ts +11 -1
- package/dist/index.js +21 -1
- package/dist/toolkits/bitbucket/tools/index.d.ts +5 -5
- package/dist/toolkits/bitbucket/tools/reports.d.ts +5 -5
- package/dist/toolkits/cloudflare/tools/create-list.d.ts +1 -1
- package/dist/toolkits/cloudflare/tools/create-zone.d.ts +1 -1
- package/dist/toolkits/cloudflare/tools/index.d.ts +4 -4
- package/dist/toolkits/cloudflare/tools/list-pools.d.ts +1 -1
- package/dist/toolkits/cloudflare/tools/list-zones.d.ts +1 -1
- package/dist/toolkits/convex/icon.d.ts +5 -0
- package/dist/toolkits/convex/icon.js +10 -0
- package/dist/toolkits/convex/manifest.d.ts +3 -0
- package/dist/toolkits/convex/manifest.js +33 -0
- package/dist/toolkits/convex/tools/client.d.ts +28 -0
- package/dist/toolkits/convex/tools/client.js +85 -0
- package/dist/toolkits/convex/tools/deploy-keys.d.ts +10 -0
- package/dist/toolkits/convex/tools/deploy-keys.js +46 -0
- package/dist/toolkits/convex/tools/deployments.d.ts +35 -0
- package/dist/toolkits/convex/tools/deployments.js +126 -0
- package/dist/toolkits/convex/tools/domains.d.ts +7 -0
- package/dist/toolkits/convex/tools/domains.js +29 -0
- package/dist/toolkits/convex/tools/functions.d.ts +14 -0
- package/dist/toolkits/convex/tools/functions.js +49 -0
- package/dist/toolkits/convex/tools/index.d.ts +176 -0
- package/dist/toolkits/convex/tools/index.js +145 -0
- package/dist/toolkits/convex/tools/logging.d.ts +5 -0
- package/dist/toolkits/convex/tools/logging.js +25 -0
- package/dist/toolkits/convex/tools/projects.d.ts +31 -0
- package/dist/toolkits/convex/tools/projects.js +111 -0
- package/dist/toolkits/convex/tools/teams.d.ts +12 -0
- package/dist/toolkits/convex/tools/teams.js +62 -0
- package/dist/toolkits/datadog/icon.d.ts +5 -0
- package/dist/toolkits/datadog/icon.js +6 -0
- package/dist/toolkits/datadog/manifest.d.ts +3 -0
- package/dist/toolkits/datadog/manifest.js +44 -0
- package/dist/toolkits/datadog/tools/api-keys.d.ts +21 -0
- package/dist/toolkits/datadog/tools/api-keys.js +42 -0
- package/dist/toolkits/datadog/tools/apm.d.ts +51 -0
- package/dist/toolkits/datadog/tools/apm.js +106 -0
- package/dist/toolkits/datadog/tools/client.d.ts +19 -0
- package/dist/toolkits/datadog/tools/client.js +81 -0
- package/dist/toolkits/datadog/tools/dashboards.d.ts +93 -0
- package/dist/toolkits/datadog/tools/dashboards.js +127 -0
- package/dist/toolkits/datadog/tools/events.d.ts +35 -0
- package/dist/toolkits/datadog/tools/events.js +56 -0
- package/dist/toolkits/datadog/tools/hosts.d.ts +49 -0
- package/dist/toolkits/datadog/tools/hosts.js +87 -0
- package/dist/toolkits/datadog/tools/incidents.d.ts +18 -0
- package/dist/toolkits/datadog/tools/incidents.js +34 -0
- package/dist/toolkits/datadog/tools/index.d.ts +999 -0
- package/dist/toolkits/datadog/tools/index.js +450 -0
- package/dist/toolkits/datadog/tools/integrations.d.ts +32 -0
- package/dist/toolkits/datadog/tools/integrations.js +47 -0
- package/dist/toolkits/datadog/tools/logs.d.ts +39 -0
- package/dist/toolkits/datadog/tools/logs.js +121 -0
- package/dist/toolkits/datadog/tools/metrics.d.ts +27 -0
- package/dist/toolkits/datadog/tools/metrics.js +83 -0
- package/dist/toolkits/datadog/tools/monitors.d.ts +95 -0
- package/dist/toolkits/datadog/tools/monitors.js +190 -0
- package/dist/toolkits/datadog/tools/oncall-notifications.d.ts +61 -0
- package/dist/toolkits/datadog/tools/oncall-notifications.js +155 -0
- package/dist/toolkits/datadog/tools/oncall-policies.d.ts +28 -0
- package/dist/toolkits/datadog/tools/oncall-policies.js +72 -0
- package/dist/toolkits/datadog/tools/oncall-schedules.d.ts +31 -0
- package/dist/toolkits/datadog/tools/oncall-schedules.js +87 -0
- package/dist/toolkits/datadog/tools/oncall-teams.d.ts +14 -0
- package/dist/toolkits/datadog/tools/oncall-teams.js +54 -0
- package/dist/toolkits/datadog/tools/slos.d.ts +43 -0
- package/dist/toolkits/datadog/tools/slos.js +62 -0
- package/dist/toolkits/datadog/tools/synthetics.d.ts +58 -0
- package/dist/toolkits/datadog/tools/synthetics.js +90 -0
- package/dist/toolkits/datadog/tools/usage.d.ts +7 -0
- package/dist/toolkits/datadog/tools/usage.js +25 -0
- package/dist/toolkits/datadog/tools/users.d.ts +35 -0
- package/dist/toolkits/datadog/tools/users.js +66 -0
- package/dist/toolkits/dev-to/icon.d.ts +5 -0
- package/dist/toolkits/dev-to/icon.js +10 -0
- package/dist/toolkits/dev-to/manifest.d.ts +3 -0
- package/dist/toolkits/dev-to/manifest.js +34 -0
- package/dist/toolkits/dev-to/tools/articles.d.ts +78 -0
- package/dist/toolkits/dev-to/tools/articles.js +262 -0
- package/dist/toolkits/dev-to/tools/client.d.ts +25 -0
- package/dist/toolkits/dev-to/tools/client.js +65 -0
- package/dist/toolkits/dev-to/tools/community.d.ts +61 -0
- package/dist/toolkits/dev-to/tools/community.js +244 -0
- package/dist/toolkits/dev-to/tools/index.d.ts +202 -0
- package/dist/toolkits/dev-to/tools/index.js +37 -0
- package/dist/toolkits/dev-to/tools/listings.d.ts +26 -0
- package/dist/toolkits/dev-to/tools/listings.js +92 -0
- package/dist/toolkits/discord/tools/applications.d.ts +5 -5
- package/dist/toolkits/discord/tools/index.d.ts +5 -5
- package/dist/toolkits/figma/tools/create-modify-delete-variables.d.ts +1 -1
- package/dist/toolkits/figma/tools/get-file-nodes.d.ts +1 -1
- package/dist/toolkits/figma/tools/index.d.ts +3 -3
- package/dist/toolkits/figma/tools/render-images-of-file-nodes.d.ts +1 -1
- package/dist/toolkits/google-analytics/tools/reports.d.ts +9 -9
- package/dist/toolkits/google-classroom/tools/index.d.ts +7 -7
- package/dist/toolkits/google-classroom/tools/invitations.d.ts +2 -2
- package/dist/toolkits/google-classroom/tools/misc.d.ts +1 -1
- package/dist/toolkits/google-classroom/tools/roster.d.ts +5 -5
- package/dist/toolkits/google-search-console/tools/index.d.ts +2 -2
- package/dist/toolkits/google-search-console/tools/search-analytics-query.d.ts +2 -2
- package/dist/toolkits/hostinger/tools/index.d.ts +1 -1
- package/dist/toolkits/hostinger/tools/whois.d.ts +1 -1
- package/dist/toolkits/hugging-face/tools/datasets-viewer.d.ts +1 -1
- package/dist/toolkits/hugging-face/tools/datasets.d.ts +1 -1
- package/dist/toolkits/hugging-face/tools/index.d.ts +1 -1
- package/dist/toolkits/hugging-face/tools/models.d.ts +1 -1
- package/dist/toolkits/hugging-face/tools/repos.d.ts +1 -1
- package/dist/toolkits/hugging-face/tools/spaces.d.ts +1 -1
- package/dist/toolkits/jira/tools/index.d.ts +4 -4
- package/dist/toolkits/jira/tools/meta.d.ts +2 -2
- package/dist/toolkits/jira/tools/users.d.ts +3 -3
- package/dist/toolkits/kaggle/icon.d.ts +5 -0
- package/dist/toolkits/kaggle/icon.js +6 -0
- package/dist/toolkits/kaggle/manifest.d.ts +3 -0
- package/dist/toolkits/kaggle/manifest.js +32 -0
- package/dist/toolkits/kaggle/tools/client.d.ts +10 -0
- package/dist/toolkits/kaggle/tools/client.js +94 -0
- package/dist/toolkits/kaggle/tools/competitions.d.ts +48 -0
- package/dist/toolkits/kaggle/tools/competitions.js +109 -0
- package/dist/toolkits/kaggle/tools/config.d.ts +110 -0
- package/dist/toolkits/kaggle/tools/config.js +256 -0
- package/dist/toolkits/kaggle/tools/datasets.d.ts +88 -0
- package/dist/toolkits/kaggle/tools/datasets.js +161 -0
- package/dist/toolkits/kaggle/tools/index.d.ts +482 -0
- package/dist/toolkits/kaggle/tools/index.js +53 -0
- package/dist/toolkits/kaggle/tools/kernels.d.ts +62 -0
- package/dist/toolkits/kaggle/tools/kernels.js +121 -0
- package/dist/toolkits/kaggle/tools/model_instance_files.d.ts +11 -0
- package/dist/toolkits/kaggle/tools/model_instance_files.js +23 -0
- package/dist/toolkits/kaggle/tools/model_instances.d.ts +8 -0
- package/dist/toolkits/kaggle/tools/model_instances.js +20 -0
- package/dist/toolkits/kaggle/tools/models.d.ts +14 -0
- package/dist/toolkits/kaggle/tools/models.js +33 -0
- package/dist/toolkits/nasa/icon.d.ts +5 -0
- package/dist/toolkits/nasa/icon.js +56 -0
- package/dist/toolkits/nasa/manifest.d.ts +3 -0
- package/dist/toolkits/nasa/manifest.js +49 -0
- package/dist/toolkits/nasa/tools/agage.d.ts +60 -0
- package/dist/toolkits/nasa/tools/agage.js +176 -0
- package/dist/toolkits/nasa/tools/client.d.ts +95 -0
- package/dist/toolkits/nasa/tools/client.js +337 -0
- package/dist/toolkits/nasa/tools/cmr.d.ts +268 -0
- package/dist/toolkits/nasa/tools/cmr.js +984 -0
- package/dist/toolkits/nasa/tools/donki.d.ts +63 -0
- package/dist/toolkits/nasa/tools/donki.js +301 -0
- package/dist/toolkits/nasa/tools/eonet.d.ts +74 -0
- package/dist/toolkits/nasa/tools/eonet.js +279 -0
- package/dist/toolkits/nasa/tools/icesat2.d.ts +25 -0
- package/dist/toolkits/nasa/tools/icesat2.js +97 -0
- package/dist/toolkits/nasa/tools/imagery.d.ts +36 -0
- package/dist/toolkits/nasa/tools/imagery.js +138 -0
- package/dist/toolkits/nasa/tools/index.d.ts +1063 -0
- package/dist/toolkits/nasa/tools/index.js +865 -0
- package/dist/toolkits/nasa/tools/neo.d.ts +15 -0
- package/dist/toolkits/nasa/tools/neo.js +75 -0
- package/dist/toolkits/nasa/tools/ntrs.d.ts +152 -0
- package/dist/toolkits/nasa/tools/ntrs.js +292 -0
- package/dist/toolkits/nasa/tools/osdr.d.ts +72 -0
- package/dist/toolkits/nasa/tools/osdr.js +290 -0
- package/dist/toolkits/nasa/tools/planetary.d.ts +58 -0
- package/dist/toolkits/nasa/tools/planetary.js +312 -0
- package/dist/toolkits/nasa/tools/power.d.ts +52 -0
- package/dist/toolkits/nasa/tools/power.js +213 -0
- package/dist/toolkits/nasa/tools/ssc.d.ts +44 -0
- package/dist/toolkits/nasa/tools/ssc.js +92 -0
- package/dist/toolkits/nasa/tools/tolnet.d.ts +84 -0
- package/dist/toolkits/nasa/tools/tolnet.js +254 -0
- package/dist/toolkits/neo4j/tools/analytics.d.ts +1 -1
- package/dist/toolkits/neo4j/tools/index.d.ts +3 -3
- package/dist/toolkits/neo4j/tools/instances.d.ts +2 -2
- package/dist/toolkits/neon/tools/auth.d.ts +4 -4
- package/dist/toolkits/neon/tools/dataapi.d.ts +1 -1
- package/dist/toolkits/neon/tools/index.d.ts +7 -7
- package/dist/toolkits/neon/tools/projects.d.ts +2 -2
- package/dist/toolkits/new-relic/icon.d.ts +5 -0
- package/dist/toolkits/new-relic/icon.js +6 -0
- package/dist/toolkits/new-relic/manifest.d.ts +3 -0
- package/dist/toolkits/new-relic/manifest.js +41 -0
- package/dist/toolkits/new-relic/tools/admin.d.ts +310 -0
- package/dist/toolkits/new-relic/tools/admin.js +282 -0
- package/dist/toolkits/new-relic/tools/alert-policies.d.ts +74 -0
- package/dist/toolkits/new-relic/tools/alert-policies.js +136 -0
- package/dist/toolkits/new-relic/tools/apm.d.ts +129 -0
- package/dist/toolkits/new-relic/tools/apm.js +228 -0
- package/dist/toolkits/new-relic/tools/client.d.ts +62 -0
- package/dist/toolkits/new-relic/tools/client.js +167 -0
- package/dist/toolkits/new-relic/tools/conditions.d.ts +190 -0
- package/dist/toolkits/new-relic/tools/conditions.js +265 -0
- package/dist/toolkits/new-relic/tools/config.d.ts +73 -0
- package/dist/toolkits/new-relic/tools/config.js +131 -0
- package/dist/toolkits/new-relic/tools/dashboards.d.ts +204 -0
- package/dist/toolkits/new-relic/tools/dashboards.js +159 -0
- package/dist/toolkits/new-relic/tools/entities.d.ts +160 -0
- package/dist/toolkits/new-relic/tools/entities.js +218 -0
- package/dist/toolkits/new-relic/tools/index.d.ts +23 -0
- package/dist/toolkits/new-relic/tools/index.js +179 -0
- package/dist/toolkits/new-relic/tools/ingest.d.ts +31 -0
- package/dist/toolkits/new-relic/tools/ingest.js +80 -0
- package/dist/toolkits/new-relic/tools/notifications.d.ts +186 -0
- package/dist/toolkits/new-relic/tools/notifications.js +232 -0
- package/dist/toolkits/new-relic/tools/nrql-conditions.d.ts +105 -0
- package/dist/toolkits/new-relic/tools/nrql-conditions.js +136 -0
- package/dist/toolkits/new-relic/tools/nrql.d.ts +38 -0
- package/dist/toolkits/new-relic/tools/nrql.js +99 -0
- package/dist/toolkits/new-relic/tools/synthetics.d.ts +176 -0
- package/dist/toolkits/new-relic/tools/synthetics.js +246 -0
- package/dist/toolkits/notebook-lm/icon.d.ts +5 -0
- package/dist/toolkits/notebook-lm/icon.js +6 -0
- package/dist/toolkits/notebook-lm/manifest.d.ts +3 -0
- package/dist/toolkits/notebook-lm/manifest.js +44 -0
- package/dist/toolkits/notebook-lm/tools/add-text-sources.d.ts +36 -0
- package/dist/toolkits/notebook-lm/tools/add-text-sources.js +51 -0
- package/dist/toolkits/notebook-lm/tools/create-audio-overview.d.ts +47 -0
- package/dist/toolkits/notebook-lm/tools/create-audio-overview.js +55 -0
- package/dist/toolkits/notebook-lm/tools/create-notebook.d.ts +52 -0
- package/dist/toolkits/notebook-lm/tools/create-notebook.js +49 -0
- package/dist/toolkits/notebook-lm/tools/delete-audio-overview.d.ts +33 -0
- package/dist/toolkits/notebook-lm/tools/delete-audio-overview.js +46 -0
- package/dist/toolkits/notebook-lm/tools/delete-notebooks.d.ts +32 -0
- package/dist/toolkits/notebook-lm/tools/delete-notebooks.js +46 -0
- package/dist/toolkits/notebook-lm/tools/delete-sources.d.ts +33 -0
- package/dist/toolkits/notebook-lm/tools/delete-sources.js +47 -0
- package/dist/toolkits/notebook-lm/tools/get-notebook.d.ts +52 -0
- package/dist/toolkits/notebook-lm/tools/get-notebook.js +45 -0
- package/dist/toolkits/notebook-lm/tools/get-source.d.ts +53 -0
- package/dist/toolkits/notebook-lm/tools/get-source.js +47 -0
- package/dist/toolkits/notebook-lm/tools/index.d.ts +516 -0
- package/dist/toolkits/notebook-lm/tools/index.js +93 -0
- package/dist/toolkits/notebook-lm/tools/list-recent-notebooks.d.ts +32 -0
- package/dist/toolkits/notebook-lm/tools/list-recent-notebooks.js +41 -0
- package/dist/toolkits/notebook-lm/tools/share-notebook.d.ts +48 -0
- package/dist/toolkits/notebook-lm/tools/share-notebook.js +57 -0
- package/dist/toolkits/notebook-lm/tools/upload-source-file.d.ts +40 -0
- package/dist/toolkits/notebook-lm/tools/upload-source-file.js +62 -0
- package/dist/toolkits/notebook-lm/tools/utils.d.ts +15 -0
- package/dist/toolkits/notebook-lm/tools/utils.js +46 -0
- package/dist/toolkits/npm/icon.d.ts +5 -0
- package/dist/toolkits/npm/icon.js +11 -0
- package/dist/toolkits/npm/manifest.d.ts +3 -0
- package/dist/toolkits/npm/manifest.js +35 -0
- package/dist/toolkits/npm/tools/client.d.ts +19 -0
- package/dist/toolkits/npm/tools/client.js +64 -0
- package/dist/toolkits/npm/tools/downloads.d.ts +19 -0
- package/dist/toolkits/npm/tools/downloads.js +39 -0
- package/dist/toolkits/npm/tools/index.d.ts +14 -0
- package/dist/toolkits/npm/tools/index.js +24 -0
- package/dist/toolkits/npm/tools/registry.d.ts +24 -0
- package/dist/toolkits/npm/tools/registry.js +58 -0
- package/dist/toolkits/npm/tools/security.d.ts +9 -0
- package/dist/toolkits/npm/tools/security.js +29 -0
- package/dist/toolkits/slack/tools/admin-users.d.ts +1 -1
- package/dist/toolkits/slack/tools/slack-lists.d.ts +3 -3
- package/dist/toolkits/snowflake/icon.d.ts +5 -0
- package/dist/toolkits/snowflake/icon.js +6 -0
- package/dist/toolkits/snowflake/manifest.d.ts +3 -0
- package/dist/toolkits/snowflake/manifest.js +32 -0
- package/dist/toolkits/snowflake/tools/catalog.d.ts +56 -0
- package/dist/toolkits/snowflake/tools/catalog.js +123 -0
- package/dist/toolkits/snowflake/tools/client.d.ts +53 -0
- package/dist/toolkits/snowflake/tools/client.js +145 -0
- package/dist/toolkits/snowflake/tools/index.d.ts +14 -0
- package/dist/toolkits/snowflake/tools/index.js +28 -0
- package/dist/toolkits/snowflake/tools/statements.d.ts +27 -0
- package/dist/toolkits/snowflake/tools/statements.js +84 -0
- package/dist/toolkits/snowflake/tools/status.d.ts +22 -0
- package/dist/toolkits/snowflake/tools/status.js +54 -0
- package/dist/toolkits/telegram/icon.d.ts +5 -0
- package/dist/toolkits/telegram/icon.js +6 -0
- package/dist/toolkits/telegram/manifest.d.ts +3 -0
- package/dist/toolkits/telegram/manifest.js +34 -0
- package/dist/toolkits/telegram/tools/bot.d.ts +13 -0
- package/dist/toolkits/telegram/tools/bot.js +23 -0
- package/dist/toolkits/telegram/tools/chats.d.ts +22 -0
- package/dist/toolkits/telegram/tools/chats.js +46 -0
- package/dist/toolkits/telegram/tools/client.d.ts +12 -0
- package/dist/toolkits/telegram/tools/client.js +46 -0
- package/dist/toolkits/telegram/tools/index.d.ts +15 -0
- package/dist/toolkits/telegram/tools/index.js +31 -0
- package/dist/toolkits/telegram/tools/messages.d.ts +86 -0
- package/dist/toolkits/telegram/tools/messages.js +134 -0
- package/dist/toolkits/telegram/tools/updates.d.ts +23 -0
- package/dist/toolkits/telegram/tools/updates.js +54 -0
- package/dist/toolkits/youtube/tools/get-channel-activities.d.ts +1 -1
- package/dist/toolkits/youtube/tools/index.d.ts +5 -5
- package/dist/toolkits/youtube/tools/list-channel-sections.d.ts +1 -1
- package/dist/toolkits/youtube/tools/post-comment.d.ts +1 -1
- package/dist/toolkits/youtube/tools/subscribe-channel.d.ts +1 -1
- package/dist/toolkits/youtube/tools/unsubscribe-channel.d.ts +1 -1
- package/package.json +2 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const slackAddEnterpriseUserToWorkspace: import("ai").Tool<{
|
|
2
2
|
teamId: string;
|
|
3
3
|
userId: string;
|
|
4
|
-
slackToken?: string | undefined;
|
|
5
4
|
channelIds?: string | undefined;
|
|
5
|
+
slackToken?: string | undefined;
|
|
6
6
|
isRestricted?: boolean | undefined;
|
|
7
7
|
isUltraRestricted?: boolean | undefined;
|
|
8
8
|
}, any>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const slackCreateList: import("ai").Tool<{
|
|
2
2
|
name: string;
|
|
3
|
+
schema?: Record<string, any>[] | undefined;
|
|
3
4
|
slackToken?: string | undefined;
|
|
4
5
|
descriptionBlocks?: string | Record<string, any> | Record<string, any>[] | undefined;
|
|
5
|
-
schema?: Record<string, any>[] | undefined;
|
|
6
6
|
todoMode?: boolean | undefined;
|
|
7
7
|
copyFromListId?: string | undefined;
|
|
8
8
|
includeCopiedListRecords?: boolean | undefined;
|
|
@@ -52,14 +52,14 @@ export declare const slackDeleteListItems: import("ai").Tool<{
|
|
|
52
52
|
export declare const slackSetListAccess: import("ai").Tool<{
|
|
53
53
|
listId: string;
|
|
54
54
|
accessLevel: string;
|
|
55
|
+
channelIds?: string[] | undefined;
|
|
55
56
|
slackToken?: string | undefined;
|
|
56
57
|
userIds?: string[] | undefined;
|
|
57
|
-
channelIds?: string[] | undefined;
|
|
58
58
|
}, any>;
|
|
59
59
|
export declare const slackDeleteListAccess: import("ai").Tool<{
|
|
60
60
|
listId: string;
|
|
61
|
+
channelIds?: string[] | undefined;
|
|
61
62
|
slackToken?: string | undefined;
|
|
62
63
|
userIds?: string[] | undefined;
|
|
63
|
-
channelIds?: string[] | undefined;
|
|
64
64
|
}, any>;
|
|
65
65
|
//# sourceMappingURL=slack-lists.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const SVG = `<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" fill="#29b5e8"><path d="M9.86 15.298l13.008 7.8a3.72 3.72 0 0 0 4.589-.601 4.01 4.01 0 0 0 1.227-2.908V3.956a3.81 3.81 0 0 0-1.861-3.42 3.81 3.81 0 0 0-3.893 0 3.81 3.81 0 0 0-1.861 3.42v8.896l-7.387-4.43a3.79 3.79 0 0 0-2.922-.4c-.986.265-1.818.94-2.3 1.844-1.057 1.9-.44 4.28 1.4 5.422m31.27 7.8l13.008-7.8c1.84-1.143 2.458-3.533 1.4-5.424a3.75 3.75 0 0 0-5.22-1.452l-7.3 4.37v-8.84a3.81 3.81 0 1 0-7.615 0v15.323a4.08 4.08 0 0 0 .494 2.367c.482.903 1.314 1.57 2.3 1.844a3.71 3.71 0 0 0 2.922-.4M29.552 31.97c.013-.25.108-.5.272-.68l1.52-1.58a1.06 1.06 0 0 1 .658-.282h.057a1.05 1.05 0 0 1 .656.282l1.52 1.58a1.12 1.12 0 0 1 .272.681v.06a1.13 1.13 0 0 1-.272.683l-1.52 1.58a1.04 1.04 0 0 1-.656.284h-.057c-.246-.014-.48-.115-.658-.284l-1.52-1.58a1.13 1.13 0 0 1-.272-.683zm-4.604-.65v1.364a1.54 1.54 0 0 0 .372.93l5.16 5.357a1.42 1.42 0 0 0 .895.386h1.312a1.42 1.42 0 0 0 .895-.386l5.16-5.357a1.54 1.54 0 0 0 .372-.93V31.32a1.54 1.54 0 0 0-.372-.93l-5.16-5.357a1.42 1.42 0 0 0-.895-.386h-1.312a1.42 1.42 0 0 0-.895.386L25.32 30.4a1.55 1.55 0 0 0-.372.93M3.13 27.62l7.365 4.417L3.13 36.45a4.06 4.06 0 0 0-1.399 5.424 3.75 3.75 0 0 0 2.3 1.844c.986.274 2.042.133 2.922-.392l13.008-7.8c1.2-.762 1.9-2.078 1.9-3.492a4.16 4.16 0 0 0-1.9-3.492l-13.008-7.8a3.79 3.79 0 0 0-2.922-.4c-.986.265-1.818.94-2.3 1.844-1.057 1.9-.44 4.278 1.4 5.422m38.995 4.442a4 4 0 0 0 1.91 3.477l13 7.8c.88.524 1.934.666 2.92.392s1.817-.94 2.3-1.843a4.05 4.05 0 0 0-1.4-5.424L53.5 32.038l7.365-4.417c1.84-1.143 2.457-3.53 1.4-5.422a3.74 3.74 0 0 0-2.3-1.844c-.987-.274-2.042-.134-2.92.4l-13 7.8a4 4 0 0 0-1.91 3.507M25.48 40.508a3.7 3.7 0 0 0-2.611.464l-13.008 7.8c-1.84 1.143-2.456 3.53-1.4 5.422.483.903 1.314 1.57 2.3 1.843a3.75 3.75 0 0 0 2.922-.392l7.387-4.43v8.83a3.81 3.81 0 1 0 7.614 0V44.4a3.91 3.91 0 0 0-3.205-3.903m28.66 8.276l-13.008-7.8a3.75 3.75 0 0 0-2.922-.392 3.74 3.74 0 0 0-2.3 1.843 4.09 4.09 0 0 0-.494 2.37v15.25a3.81 3.81 0 1 0 7.614 0V51.28l7.287 4.37a3.79 3.79 0 0 0 2.922.4c.986-.265 1.818-.94 2.3-1.844 1.057-1.9.44-4.28-1.4-5.422"/></svg>`;
|
|
2
|
+
export const SNOWFLAKE_ICON = {
|
|
3
|
+
kind: 'svg',
|
|
4
|
+
dataUri: `data:image/svg+xml;base64,${Buffer.from(SVG).toString('base64')}`,
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=icon.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineToolkit, defineTool } from '../../core/define.js';
|
|
2
|
+
import { inferToolScope } from '../../core/scope.js';
|
|
3
|
+
import { SNOWFLAKE_ICON } from './icon.js';
|
|
4
|
+
import { snowflakeTools } from './tools/index.js';
|
|
5
|
+
export default defineToolkit({
|
|
6
|
+
id: 'snowflake',
|
|
7
|
+
displayName: 'Snowflake',
|
|
8
|
+
shortDescription: 'Execute SQL, browse catalog objects, and check service status.',
|
|
9
|
+
category: 'Developer Tools & DevOps',
|
|
10
|
+
icon: SNOWFLAKE_ICON,
|
|
11
|
+
auth: {
|
|
12
|
+
type: 'service_account',
|
|
13
|
+
tokenField: 'snowflakeCredentials',
|
|
14
|
+
provider: {
|
|
15
|
+
fields: ['accountHost', 'token'],
|
|
16
|
+
connectDescription: 'Connect Snowflake with your account host (e.g. org-account, a full host, or https URL) and an access token. The token is sent as Authorization: Bearer on the SQL API v2. Use an OAuth access token from your Snowflake OAuth integration (recommended), a programmatic access token (PAT), or a key-pair JWT. OAuth authorize/token URLs are account-specific, so paste a token rather than an OAuth client flow. Status-page tools are public and need no credentials.',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
tools: snowflakeTools.map((entry) => defineTool({
|
|
20
|
+
name: entry.name,
|
|
21
|
+
description: entry.description,
|
|
22
|
+
tool: entry.tool,
|
|
23
|
+
requiredAuth: entry.requiredAuth,
|
|
24
|
+
scope: entry.scope ?? inferToolScope(entry.name),
|
|
25
|
+
})),
|
|
26
|
+
meta: {
|
|
27
|
+
since: '0.0.10',
|
|
28
|
+
homepage: 'https://www.snowflake.com',
|
|
29
|
+
docsUrl: 'https://docs.snowflake.com/en/developer-guide/sql-api/intro',
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export declare const showDatabases: import("ai").Tool<{
|
|
2
|
+
limit?: number | undefined;
|
|
3
|
+
timeout?: number | undefined;
|
|
4
|
+
startsWith?: string | undefined;
|
|
5
|
+
role?: string | undefined;
|
|
6
|
+
snowflakeCredentials?: string | undefined;
|
|
7
|
+
warehouse?: string | undefined;
|
|
8
|
+
terse?: boolean | undefined;
|
|
9
|
+
history?: boolean | undefined;
|
|
10
|
+
likePattern?: string | undefined;
|
|
11
|
+
fromName?: string | undefined;
|
|
12
|
+
}, any>;
|
|
13
|
+
export declare const showSchemas: import("ai").Tool<{
|
|
14
|
+
limit?: number | undefined;
|
|
15
|
+
timeout?: number | undefined;
|
|
16
|
+
startsWith?: string | undefined;
|
|
17
|
+
role?: string | undefined;
|
|
18
|
+
database?: string | undefined;
|
|
19
|
+
snowflakeCredentials?: string | undefined;
|
|
20
|
+
warehouse?: string | undefined;
|
|
21
|
+
terse?: boolean | undefined;
|
|
22
|
+
history?: boolean | undefined;
|
|
23
|
+
likePattern?: string | undefined;
|
|
24
|
+
fromName?: string | undefined;
|
|
25
|
+
inScope?: string | undefined;
|
|
26
|
+
}, any>;
|
|
27
|
+
export declare const showTables: import("ai").Tool<{
|
|
28
|
+
limit?: number | undefined;
|
|
29
|
+
timeout?: number | undefined;
|
|
30
|
+
startsWith?: string | undefined;
|
|
31
|
+
role?: string | undefined;
|
|
32
|
+
database?: string | undefined;
|
|
33
|
+
snowflakeCredentials?: string | undefined;
|
|
34
|
+
warehouse?: string | undefined;
|
|
35
|
+
terse?: boolean | undefined;
|
|
36
|
+
history?: boolean | undefined;
|
|
37
|
+
likePattern?: string | undefined;
|
|
38
|
+
fromName?: string | undefined;
|
|
39
|
+
inScope?: string | undefined;
|
|
40
|
+
schema?: string | undefined;
|
|
41
|
+
}, any>;
|
|
42
|
+
export declare const dropWarehouse: import("ai").Tool<{
|
|
43
|
+
name: string;
|
|
44
|
+
timeout?: number | undefined;
|
|
45
|
+
role?: string | undefined;
|
|
46
|
+
snowflakeCredentials?: string | undefined;
|
|
47
|
+
ifExists?: boolean | undefined;
|
|
48
|
+
}, any>;
|
|
49
|
+
export declare const fetchCatalogIntegration: import("ai").Tool<{
|
|
50
|
+
name: string;
|
|
51
|
+
timeout?: number | undefined;
|
|
52
|
+
role?: string | undefined;
|
|
53
|
+
snowflakeCredentials?: string | undefined;
|
|
54
|
+
warehouse?: string | undefined;
|
|
55
|
+
}, any>;
|
|
56
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { tool } from 'ai';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { buildShow, parseCredentials, quoteIdent, snowflakeCredentialsField, submitStatement } from './client.js';
|
|
5
|
+
const showContext = {
|
|
6
|
+
role: z.string().optional().describe('Role for the SHOW statement'),
|
|
7
|
+
warehouse: z.string().optional().describe('Warehouse (SHOW works without a running warehouse)'),
|
|
8
|
+
timeout: z.number().int().optional().describe('Timeout seconds'),
|
|
9
|
+
};
|
|
10
|
+
const showFilters = {
|
|
11
|
+
terse: z.boolean().optional().describe('Subset of columns only'),
|
|
12
|
+
history: z.boolean().optional().describe('Include dropped objects within Time Travel retention'),
|
|
13
|
+
likePattern: z.string().optional().describe("SQL wildcard filter (% and _), e.g. '%test%' (case-insensitive)"),
|
|
14
|
+
startsWith: z.string().optional().describe("Prefix filter, e.g. 'PROD' (case-sensitive)"),
|
|
15
|
+
limit: z.number().int().min(1).max(10000).optional().describe('Max rows (<= 10000)'),
|
|
16
|
+
fromName: z.string().optional().describe('With limit: start pagination at names matching this string'),
|
|
17
|
+
};
|
|
18
|
+
export const showDatabases = tool({
|
|
19
|
+
description: 'Lists accessible databases (name, created date, owner, retention). Supports LIKE/prefix filters, history, and limit/from pagination.',
|
|
20
|
+
inputSchema: z.object({ snowflakeCredentials: snowflakeCredentialsField, ...showContext, ...showFilters }),
|
|
21
|
+
execute: async ({ snowflakeCredentials, terse, history, likePattern, startsWith, limit, fromName, ...ctx }) => {
|
|
22
|
+
const creds = parseCredentials(snowflakeCredentials);
|
|
23
|
+
if (creds?.error)
|
|
24
|
+
return creds;
|
|
25
|
+
return submitStatement(creds, { statement: buildShow('DATABASES', undefined, { terse, history, likePattern, startsWith, limit, fromName }), ...ctx }, 'show databases');
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
export const showSchemas = tool({
|
|
29
|
+
description: 'Lists accessible schemas (name, database, owner, retention). Scope via in_scope: ACCOUNT, DATABASE (+database), or a database name.',
|
|
30
|
+
inputSchema: z.object({
|
|
31
|
+
snowflakeCredentials: snowflakeCredentialsField,
|
|
32
|
+
database: z.string().optional().describe('Database context (used with in_scope DATABASE)'),
|
|
33
|
+
inScope: z.string().optional().describe("Scope: 'ACCOUNT', 'DATABASE', or a database name"),
|
|
34
|
+
...showContext,
|
|
35
|
+
...showFilters,
|
|
36
|
+
}),
|
|
37
|
+
execute: async ({ snowflakeCredentials, database, inScope, terse, history, likePattern, startsWith, limit, fromName, ...ctx }) => {
|
|
38
|
+
const creds = parseCredentials(snowflakeCredentials);
|
|
39
|
+
if (creds?.error)
|
|
40
|
+
return creds;
|
|
41
|
+
let scope;
|
|
42
|
+
if (inScope) {
|
|
43
|
+
const upper = inScope.toUpperCase();
|
|
44
|
+
if (upper === 'ACCOUNT')
|
|
45
|
+
scope = 'IN ACCOUNT';
|
|
46
|
+
else if (upper === 'DATABASE')
|
|
47
|
+
scope = database ? `IN DATABASE ${quoteIdent(database)}` : 'IN DATABASE';
|
|
48
|
+
else
|
|
49
|
+
scope = `IN DATABASE ${quoteIdent(inScope)}`;
|
|
50
|
+
}
|
|
51
|
+
else if (database) {
|
|
52
|
+
scope = `IN DATABASE ${quoteIdent(database)}`;
|
|
53
|
+
}
|
|
54
|
+
return submitStatement(creds, { statement: buildShow('SCHEMAS', scope, { terse, history, likePattern, startsWith, limit, fromName }), database, ...ctx }, 'show schemas');
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
export const showTables = tool({
|
|
58
|
+
description: 'Lists accessible tables (rows, bytes, clustering, retention). Scope with database/schema or in_scope; supports LIKE/prefix/history/pagination.',
|
|
59
|
+
inputSchema: z.object({
|
|
60
|
+
snowflakeCredentials: snowflakeCredentialsField,
|
|
61
|
+
database: z.string().optional().describe('Database context'),
|
|
62
|
+
schema: z.string().optional().describe('Schema context (with database → IN SCHEMA db.schema)'),
|
|
63
|
+
inScope: z.string().optional().describe("Scope: 'ACCOUNT', 'DATABASE', 'SCHEMA', or a qualified name"),
|
|
64
|
+
...showContext,
|
|
65
|
+
...showFilters,
|
|
66
|
+
}),
|
|
67
|
+
execute: async ({ snowflakeCredentials, database, schema, inScope, terse, history, likePattern, startsWith, limit, fromName, ...ctx }) => {
|
|
68
|
+
const creds = parseCredentials(snowflakeCredentials);
|
|
69
|
+
if (creds?.error)
|
|
70
|
+
return creds;
|
|
71
|
+
let scope;
|
|
72
|
+
if (database && schema)
|
|
73
|
+
scope = `IN SCHEMA ${quoteIdent(database)}.${quoteIdent(schema)}`;
|
|
74
|
+
else if (inScope) {
|
|
75
|
+
const upper = inScope.toUpperCase();
|
|
76
|
+
if (upper === 'ACCOUNT')
|
|
77
|
+
scope = 'IN ACCOUNT';
|
|
78
|
+
else if (upper === 'DATABASE')
|
|
79
|
+
scope = database ? `IN DATABASE ${quoteIdent(database)}` : 'IN DATABASE';
|
|
80
|
+
else if (upper === 'SCHEMA')
|
|
81
|
+
scope = database && schema ? `IN SCHEMA ${quoteIdent(database)}.${quoteIdent(schema)}` : 'IN SCHEMA';
|
|
82
|
+
else
|
|
83
|
+
scope = `IN ${inScope}`;
|
|
84
|
+
}
|
|
85
|
+
else if (database) {
|
|
86
|
+
scope = `IN DATABASE ${quoteIdent(database)}`;
|
|
87
|
+
}
|
|
88
|
+
return submitStatement(creds, { statement: buildShow('TABLES', scope, { terse, history, likePattern, startsWith, limit, fromName }), database, schema, ...ctx }, 'show tables');
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
export const dropWarehouse = tool({
|
|
92
|
+
description: 'Permanently drops a warehouse (irreversible). Requires appropriate privileges; use if_exists to skip errors when absent.',
|
|
93
|
+
inputSchema: z.object({
|
|
94
|
+
snowflakeCredentials: snowflakeCredentialsField,
|
|
95
|
+
name: z.string().describe('Warehouse name to drop'),
|
|
96
|
+
ifExists: z.boolean().optional().describe('Skip error when the warehouse does not exist'),
|
|
97
|
+
role: z.string().optional(),
|
|
98
|
+
timeout: z.number().int().optional(),
|
|
99
|
+
}),
|
|
100
|
+
execute: async ({ snowflakeCredentials, name, ifExists, ...ctx }) => {
|
|
101
|
+
const creds = parseCredentials(snowflakeCredentials);
|
|
102
|
+
if (creds?.error)
|
|
103
|
+
return creds;
|
|
104
|
+
return submitStatement(creds, { statement: `DROP WAREHOUSE ${ifExists ? 'IF EXISTS ' : ''}${quoteIdent(name)}`, ...ctx }, 'drop warehouse');
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
export const fetchCatalogIntegration = tool({
|
|
108
|
+
description: 'Describes a catalog integration (Iceberg: AWS Glue, Open Catalog/Polaris, REST) — configuration and metadata.',
|
|
109
|
+
inputSchema: z.object({
|
|
110
|
+
snowflakeCredentials: snowflakeCredentialsField,
|
|
111
|
+
name: z.string().describe('Catalog integration name'),
|
|
112
|
+
role: z.string().optional(),
|
|
113
|
+
warehouse: z.string().optional(),
|
|
114
|
+
timeout: z.number().int().optional(),
|
|
115
|
+
}),
|
|
116
|
+
execute: async ({ snowflakeCredentials, name, ...ctx }) => {
|
|
117
|
+
const creds = parseCredentials(snowflakeCredentials);
|
|
118
|
+
if (creds?.error)
|
|
119
|
+
return creds;
|
|
120
|
+
return submitStatement(creds, { statement: `DESCRIBE CATALOG INTEGRATION ${quoteIdent(name)}`, ...ctx }, 'describe catalog integration');
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const STATUSPAGE_BASE = "https://status.snowflake.com/api/v2";
|
|
3
|
+
/** Credential JSON: { accountHost, token }. Token is an OAuth access token (or PAT / key-pair JWT). */
|
|
4
|
+
export interface SnowflakeCredentials {
|
|
5
|
+
accountHost: string;
|
|
6
|
+
token: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const snowflakeCredentialsField: z.ZodOptional<z.ZodString>;
|
|
9
|
+
export declare function missingCredentials(): {
|
|
10
|
+
error: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function parseCredentials(raw: string | undefined): SnowflakeCredentials | {
|
|
13
|
+
error: string;
|
|
14
|
+
};
|
|
15
|
+
/** Normalize account host: accepts bare locator, full host, or URL. */
|
|
16
|
+
export declare function normalizeHost(accountHost: string): string;
|
|
17
|
+
export interface SnowflakeRequestOptions {
|
|
18
|
+
method?: string;
|
|
19
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
20
|
+
body?: unknown;
|
|
21
|
+
/** Idempotency key sent as requestId for statement submission. */
|
|
22
|
+
requestId?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function snowflakeSqlApi(creds: SnowflakeCredentials, path: string, options?: SnowflakeRequestOptions): Promise<any>;
|
|
25
|
+
/** Submit a statement (sync by default) and return the raw API response. */
|
|
26
|
+
export declare function submitStatement(creds: SnowflakeCredentials, input: {
|
|
27
|
+
statement: string;
|
|
28
|
+
role?: string;
|
|
29
|
+
warehouse?: string;
|
|
30
|
+
database?: string;
|
|
31
|
+
schema?: string;
|
|
32
|
+
timeout?: number;
|
|
33
|
+
bindings?: Record<string, unknown>;
|
|
34
|
+
parameters?: Record<string, unknown>;
|
|
35
|
+
async?: boolean;
|
|
36
|
+
requestId?: string;
|
|
37
|
+
}, action?: string): Promise<any>;
|
|
38
|
+
declare function quoteIdent(value: string): string;
|
|
39
|
+
declare function quoteLiteral(value: string): string;
|
|
40
|
+
export interface ShowOptions {
|
|
41
|
+
terse?: boolean;
|
|
42
|
+
history?: boolean;
|
|
43
|
+
likePattern?: string;
|
|
44
|
+
startsWith?: string;
|
|
45
|
+
limit?: number;
|
|
46
|
+
fromName?: string;
|
|
47
|
+
}
|
|
48
|
+
/** Build SHOW <objects> SQL from common filter options. */
|
|
49
|
+
export declare function buildShow(objects: 'DATABASES' | 'SCHEMAS' | 'TABLES', scope: string | undefined, opts: ShowOptions): string;
|
|
50
|
+
export { quoteIdent, quoteLiteral };
|
|
51
|
+
/** Public Snowflake status page (Statuspage API, no auth). */
|
|
52
|
+
export declare function statusPage(path: string, action?: string): Promise<any>;
|
|
53
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export const STATUSPAGE_BASE = 'https://status.snowflake.com/api/v2';
|
|
4
|
+
export const snowflakeCredentialsField = z
|
|
5
|
+
.string()
|
|
6
|
+
.optional()
|
|
7
|
+
.describe('Snowflake credential JSON {accountHost, token}. Injected at runtime.');
|
|
8
|
+
export function missingCredentials() {
|
|
9
|
+
return { error: 'Snowflake credentials are required. Connect Snowflake first with your account host and access token.' };
|
|
10
|
+
}
|
|
11
|
+
export function parseCredentials(raw) {
|
|
12
|
+
if (!raw)
|
|
13
|
+
return missingCredentials();
|
|
14
|
+
try {
|
|
15
|
+
const parsed = JSON.parse(raw);
|
|
16
|
+
if (!parsed.accountHost || !parsed.token) {
|
|
17
|
+
return { error: 'Snowflake credentials must be JSON with accountHost and token, e.g. {"accountHost":"org-account","token":"..."}' };
|
|
18
|
+
}
|
|
19
|
+
return parsed;
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return { error: 'Snowflake credentials must be valid JSON with accountHost and token.' };
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** Normalize account host: accepts bare locator, full host, or URL. */
|
|
26
|
+
export function normalizeHost(accountHost) {
|
|
27
|
+
let host = accountHost.trim().replace(/^https?:\/\//, '').replace(/\/+$/, '');
|
|
28
|
+
if (!host.includes('.'))
|
|
29
|
+
host = `${host}.snowflakecomputing.com`;
|
|
30
|
+
return `https://${host}`;
|
|
31
|
+
}
|
|
32
|
+
export async function snowflakeSqlApi(creds, path, options) {
|
|
33
|
+
const base = normalizeHost(creds.accountHost);
|
|
34
|
+
let url = `${base}/api/v2${path}`;
|
|
35
|
+
const search = new URLSearchParams();
|
|
36
|
+
for (const [k, v] of Object.entries(options?.query ?? {})) {
|
|
37
|
+
if (v !== undefined)
|
|
38
|
+
search.set(k, String(v));
|
|
39
|
+
}
|
|
40
|
+
if (options?.requestId)
|
|
41
|
+
search.set('requestId', options.requestId);
|
|
42
|
+
const qs = search.toString();
|
|
43
|
+
if (qs)
|
|
44
|
+
url += `?${qs}`;
|
|
45
|
+
try {
|
|
46
|
+
const response = await fetch(url, {
|
|
47
|
+
method: options?.method ?? 'GET',
|
|
48
|
+
headers: {
|
|
49
|
+
Authorization: `Bearer ${creds.token}`,
|
|
50
|
+
'Content-Type': 'application/json',
|
|
51
|
+
Accept: 'application/json',
|
|
52
|
+
'X-Snowflake-Authorization-Token-Type': 'OAUTH',
|
|
53
|
+
'User-Agent': 'rnsk-toolkits/1.0',
|
|
54
|
+
},
|
|
55
|
+
body: options?.body !== undefined ? JSON.stringify(options.body) : undefined,
|
|
56
|
+
});
|
|
57
|
+
const text = await response.text();
|
|
58
|
+
let data = {};
|
|
59
|
+
if (text) {
|
|
60
|
+
try {
|
|
61
|
+
data = JSON.parse(text);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
data = { raw: text };
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (!response.ok)
|
|
68
|
+
return { error: 'Snowflake SQL API request failed', status: response.status, details: data };
|
|
69
|
+
return data;
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
return { error: 'Error calling Snowflake SQL API', message: error instanceof Error ? error.message : 'Unknown error' };
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** Submit a statement (sync by default) and return the raw API response. */
|
|
76
|
+
export async function submitStatement(creds, input, action = 'execute SQL statement') {
|
|
77
|
+
try {
|
|
78
|
+
const body = { statement: input.statement };
|
|
79
|
+
if (input.timeout !== undefined)
|
|
80
|
+
body.timeout = input.timeout;
|
|
81
|
+
if (input.database)
|
|
82
|
+
body.database = input.database;
|
|
83
|
+
if (input.schema)
|
|
84
|
+
body.schema = input.schema;
|
|
85
|
+
if (input.warehouse)
|
|
86
|
+
body.warehouse = input.warehouse;
|
|
87
|
+
if (input.role)
|
|
88
|
+
body.role = input.role;
|
|
89
|
+
if (input.bindings)
|
|
90
|
+
body.bindings = input.bindings;
|
|
91
|
+
if (input.parameters)
|
|
92
|
+
body.parameters = input.parameters;
|
|
93
|
+
if (input.async !== undefined)
|
|
94
|
+
body.async = input.async;
|
|
95
|
+
const result = await snowflakeSqlApi(creds, '/statements', { method: 'POST', body, requestId: input.requestId });
|
|
96
|
+
if (result?.error)
|
|
97
|
+
return { error: `Failed to ${action}`, ...result };
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
return { error: `Error while trying to ${action}`, message: error instanceof Error ? error.message : 'Unknown error' };
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function quoteIdent(value) {
|
|
105
|
+
return `"${value.replace(/"/g, '""')}"`;
|
|
106
|
+
}
|
|
107
|
+
function quoteLiteral(value) {
|
|
108
|
+
return `'${value.replace(/'/g, "''")}'`;
|
|
109
|
+
}
|
|
110
|
+
/** Build SHOW <objects> SQL from common filter options. */
|
|
111
|
+
export function buildShow(objects, scope, opts) {
|
|
112
|
+
const parts = ['SHOW'];
|
|
113
|
+
if (opts.terse)
|
|
114
|
+
parts.push('TERSE');
|
|
115
|
+
parts.push(objects);
|
|
116
|
+
if (opts.history)
|
|
117
|
+
parts.push('HISTORY');
|
|
118
|
+
if (opts.likePattern)
|
|
119
|
+
parts.push(`LIKE ${quoteLiteral(opts.likePattern)}`);
|
|
120
|
+
if (scope)
|
|
121
|
+
parts.push(scope);
|
|
122
|
+
if (opts.startsWith)
|
|
123
|
+
parts.push(`STARTS WITH ${quoteLiteral(opts.startsWith)}`);
|
|
124
|
+
if (opts.limit !== undefined) {
|
|
125
|
+
parts.push(`LIMIT ${opts.limit}`);
|
|
126
|
+
if (opts.fromName)
|
|
127
|
+
parts.push(`FROM ${quoteLiteral(opts.fromName)}`);
|
|
128
|
+
}
|
|
129
|
+
return parts.join(' ');
|
|
130
|
+
}
|
|
131
|
+
export { quoteIdent, quoteLiteral };
|
|
132
|
+
/** Public Snowflake status page (Statuspage API, no auth). */
|
|
133
|
+
export async function statusPage(path, action = 'query Snowflake status page') {
|
|
134
|
+
try {
|
|
135
|
+
const response = await fetch(`${STATUSPAGE_BASE}${path}`, { headers: { Accept: 'application/json' } });
|
|
136
|
+
const data = await response.json().catch(() => ({}));
|
|
137
|
+
if (!response.ok)
|
|
138
|
+
return { error: `Failed to ${action}`, details: data };
|
|
139
|
+
return data;
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
return { error: `Error while trying to ${action}`, message: error instanceof Error ? error.message : 'Unknown error' };
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { dropWarehouse, fetchCatalogIntegration, showDatabases, showSchemas, showTables } from './catalog.js';
|
|
2
|
+
import { cancelStatementExecution, checkStatementStatus, executeSql, validateCredential } from './statements.js';
|
|
3
|
+
import { getActiveScheduledMaintenances, getAllScheduledMaintenances, getComponentStatus, getStatusRollup, getStatusSummary, getUnresolvedIncidents, getUpcomingScheduledMaintenances } from './status.js';
|
|
4
|
+
export { executeSql, checkStatementStatus, cancelStatementExecution, validateCredential, showDatabases, showSchemas, showTables, dropWarehouse, fetchCatalogIntegration, getStatusSummary, getStatusRollup, getComponentStatus, getUnresolvedIncidents, getActiveScheduledMaintenances, getUpcomingScheduledMaintenances, getAllScheduledMaintenances, };
|
|
5
|
+
declare const auth: "snowflakeCredentials";
|
|
6
|
+
type Scope = 'read' | 'write' | 'delete';
|
|
7
|
+
export declare const snowflakeTools: {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
tool: any;
|
|
11
|
+
requiredAuth?: typeof auth;
|
|
12
|
+
scope: Scope;
|
|
13
|
+
}[];
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { dropWarehouse, fetchCatalogIntegration, showDatabases, showSchemas, showTables, } from './catalog.js';
|
|
3
|
+
import { cancelStatementExecution, checkStatementStatus, executeSql, validateCredential, } from './statements.js';
|
|
4
|
+
import { getActiveScheduledMaintenances, getAllScheduledMaintenances, getComponentStatus, getStatusRollup, getStatusSummary, getUnresolvedIncidents, getUpcomingScheduledMaintenances, } from './status.js';
|
|
5
|
+
export { executeSql, checkStatementStatus, cancelStatementExecution, validateCredential, showDatabases, showSchemas, showTables, dropWarehouse, fetchCatalogIntegration, getStatusSummary, getStatusRollup, getComponentStatus, getUnresolvedIncidents, getActiveScheduledMaintenances, getUpcomingScheduledMaintenances, getAllScheduledMaintenances, };
|
|
6
|
+
const auth = 'snowflakeCredentials';
|
|
7
|
+
function entry(name, description, toolRef, scope, noAuth = false) {
|
|
8
|
+
return noAuth ? { name, description, tool: toolRef, scope } : { name, description, tool: toolRef, requiredAuth: auth, scope };
|
|
9
|
+
}
|
|
10
|
+
export const snowflakeTools = [
|
|
11
|
+
entry('snowflakeExecuteSql', 'Executes SQL synchronously and returns rows (SELECT, DDL, DML, batches).', executeSql, 'write'),
|
|
12
|
+
entry('snowflakeCheckStatementStatus', 'Polls an async statement by handle; follows result partitions.', checkStatementStatus, 'read'),
|
|
13
|
+
entry('snowflakeCancelStatementExecution', 'Cancels a running statement by handle.', cancelStatementExecution, 'delete'),
|
|
14
|
+
entry('snowflakeValidateCredential', 'Validates credentials with a lightweight session query.', validateCredential, 'read'),
|
|
15
|
+
entry('snowflakeShowDatabases', 'Lists accessible databases with filters and pagination.', showDatabases, 'read'),
|
|
16
|
+
entry('snowflakeShowSchemas', 'Lists accessible schemas with scope and filters.', showSchemas, 'read'),
|
|
17
|
+
entry('snowflakeShowTables', 'Lists accessible tables with scope and filters.', showTables, 'read'),
|
|
18
|
+
entry('snowflakeDropWarehouse', 'Permanently drops a warehouse (irreversible).', dropWarehouse, 'delete'),
|
|
19
|
+
entry('snowflakeFetchCatalogIntegration', 'Describes an Iceberg catalog integration.', fetchCatalogIntegration, 'read'),
|
|
20
|
+
entry('snowflakeGetStatusSummary', 'Reads the public status summary (overall + regions + incidents).', getStatusSummary, 'read', true),
|
|
21
|
+
entry('snowflakeGetStatusRollup', 'Reads the public page rollup (indicator + description).', getStatusRollup, 'read', true),
|
|
22
|
+
entry('snowflakeGetComponentStatus', 'Lists per-component status (public, limit applied locally).', getComponentStatus, 'read', true),
|
|
23
|
+
entry('snowflakeGetUnresolvedIncidents', 'Lists unresolved incidents (public).', getUnresolvedIncidents, 'read', true),
|
|
24
|
+
entry('snowflakeGetActiveScheduledMaintenances', 'Lists in-progress/verifying maintenances (public).', getActiveScheduledMaintenances, 'read', true),
|
|
25
|
+
entry('snowflakeGetUpcomingScheduledMaintenances', 'Lists scheduled (not started) maintenances (public).', getUpcomingScheduledMaintenances, 'read', true),
|
|
26
|
+
entry('snowflakeGetAllScheduledMaintenances', 'Lists the 50 most recent maintenances (public).', getAllScheduledMaintenances, 'read', true),
|
|
27
|
+
];
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const executeSql: import("ai").Tool<{
|
|
2
|
+
statement: string;
|
|
3
|
+
timeout?: number | undefined;
|
|
4
|
+
parameters?: Record<string, any> | undefined;
|
|
5
|
+
role?: string | undefined;
|
|
6
|
+
database?: string | undefined;
|
|
7
|
+
snowflakeCredentials?: string | undefined;
|
|
8
|
+
schemaName?: string | undefined;
|
|
9
|
+
bindings?: Record<string, any> | undefined;
|
|
10
|
+
requestId?: string | undefined;
|
|
11
|
+
warehouse?: string | undefined;
|
|
12
|
+
}, any>;
|
|
13
|
+
export declare const checkStatementStatus: import("ai").Tool<{
|
|
14
|
+
statementHandle: string;
|
|
15
|
+
snowflakeCredentials?: string | undefined;
|
|
16
|
+
requestId?: string | undefined;
|
|
17
|
+
partition?: number | undefined;
|
|
18
|
+
}, any>;
|
|
19
|
+
export declare const cancelStatementExecution: import("ai").Tool<{
|
|
20
|
+
statementHandle: string;
|
|
21
|
+
snowflakeCredentials?: string | undefined;
|
|
22
|
+
requestId?: string | undefined;
|
|
23
|
+
}, any>;
|
|
24
|
+
export declare const validateCredential: import("ai").Tool<{
|
|
25
|
+
snowflakeCredentials?: string | undefined;
|
|
26
|
+
}, any>;
|
|
27
|
+
//# sourceMappingURL=statements.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { tool } from 'ai';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { parseCredentials, snowflakeCredentialsField, snowflakeSqlApi, submitStatement } from './client.js';
|
|
5
|
+
const executionContext = {
|
|
6
|
+
role: z.string().optional().describe("Role (case-sensitive; default the token user's DEFAULT_ROLE)"),
|
|
7
|
+
warehouse: z.string().optional().describe('Warehouse (case-sensitive; required for compute; default DEFAULT_WAREHOUSE)'),
|
|
8
|
+
database: z.string().optional().describe("Database (case-sensitive; default DEFAULT_NAMESPACE)"),
|
|
9
|
+
timeout: z.number().int().optional().describe('Timeout seconds (0 = max 604800; default server default)'),
|
|
10
|
+
};
|
|
11
|
+
export const executeSql = tool({
|
|
12
|
+
description: 'Executes SQL synchronously (SELECT, DDL, DML; semicolon-separated batches run in sequence) and returns rows. For INFORMATION_SCHEMA filter on table_schema + table_catalog and parenthesize mixed AND/OR.',
|
|
13
|
+
inputSchema: z.object({
|
|
14
|
+
snowflakeCredentials: snowflakeCredentialsField,
|
|
15
|
+
statement: z.string().min(1).describe("SQL text, e.g. 'SELECT * FROM my_table;'"),
|
|
16
|
+
schemaName: z.string().optional().describe('Schema context (maps to SQL API schema)'),
|
|
17
|
+
bindings: z.record(z.any()).optional().describe('Bind variables for parameterized queries (prevents SQL injection)'),
|
|
18
|
+
parameters: z.record(z.any()).optional().describe('Session parameters, e.g. STATEMENT_TIMEOUT_IN_SECONDS'),
|
|
19
|
+
requestId: z.string().optional().describe('Idempotency key (UUID) — safe retries reuse the same statement'),
|
|
20
|
+
...executionContext,
|
|
21
|
+
}),
|
|
22
|
+
execute: async ({ snowflakeCredentials, statement, schemaName, bindings, parameters, requestId, ...ctx }) => {
|
|
23
|
+
const creds = parseCredentials(snowflakeCredentials);
|
|
24
|
+
if (creds?.error)
|
|
25
|
+
return creds;
|
|
26
|
+
return submitStatement(creds, { statement, schema: schemaName, bindings, parameters, requestId, ...ctx });
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
export const checkStatementStatus = tool({
|
|
30
|
+
description: 'Polls an async statement by handle until no longer pending; follows partition pages for large result sets. Pair with executeSql async batches or the deprecated submit flow.',
|
|
31
|
+
inputSchema: z.object({
|
|
32
|
+
snowflakeCredentials: snowflakeCredentialsField,
|
|
33
|
+
statementHandle: z.string().describe('Statement handle UUID from submission'),
|
|
34
|
+
partition: z.number().int().min(0).optional().describe('Result partition index (0-based) for paged fetches'),
|
|
35
|
+
requestId: z.string().optional().describe('Idempotency key echoed on the request'),
|
|
36
|
+
}),
|
|
37
|
+
execute: async ({ snowflakeCredentials, statementHandle, partition, requestId }) => {
|
|
38
|
+
const creds = parseCredentials(snowflakeCredentials);
|
|
39
|
+
if (creds?.error)
|
|
40
|
+
return creds;
|
|
41
|
+
try {
|
|
42
|
+
const result = await snowflakeSqlApi(creds, `/statements/${statementHandle}`, { query: { partition }, requestId });
|
|
43
|
+
if (result?.error)
|
|
44
|
+
return { error: 'Failed to check statement status', ...result };
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
return { error: 'Error checking statement status', message: error instanceof Error ? error.message : 'Unknown error' };
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
export const cancelStatementExecution = tool({
|
|
53
|
+
description: 'Cancels a running statement by handle. Use to stop long-running queries.',
|
|
54
|
+
inputSchema: z.object({
|
|
55
|
+
snowflakeCredentials: snowflakeCredentialsField,
|
|
56
|
+
statementHandle: z.string().describe('Handle of the running statement to cancel'),
|
|
57
|
+
requestId: z.string().optional().describe('Idempotency key echoed on the request'),
|
|
58
|
+
}),
|
|
59
|
+
execute: async ({ snowflakeCredentials, statementHandle, requestId }) => {
|
|
60
|
+
const creds = parseCredentials(snowflakeCredentials);
|
|
61
|
+
if (creds?.error)
|
|
62
|
+
return creds;
|
|
63
|
+
try {
|
|
64
|
+
const result = await snowflakeSqlApi(creds, `/statements/${statementHandle}/cancel`, { method: 'POST', requestId });
|
|
65
|
+
if (result?.error)
|
|
66
|
+
return { error: 'Failed to cancel statement', ...result };
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
return { error: 'Error canceling statement', message: error instanceof Error ? error.message : 'Unknown error' };
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
export const validateCredential = tool({
|
|
75
|
+
description: 'Validates credentials with a lightweight session query. Returns user/role/warehouse/database/schema/version on success, auth details on failure.',
|
|
76
|
+
inputSchema: z.object({ snowflakeCredentials: snowflakeCredentialsField }),
|
|
77
|
+
execute: async ({ snowflakeCredentials }) => {
|
|
78
|
+
const creds = parseCredentials(snowflakeCredentials);
|
|
79
|
+
if (creds?.error)
|
|
80
|
+
return creds;
|
|
81
|
+
return submitStatement(creds, { statement: 'SELECT CURRENT_USER() AS "user", CURRENT_ROLE() AS "role", CURRENT_WAREHOUSE() AS "warehouse", CURRENT_DATABASE() AS "database", CURRENT_SCHEMA() AS "schema", CURRENT_VERSION() AS "version"' }, 'validate credentials');
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=statements.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const getStatusSummary: import("ai").Tool<{
|
|
2
|
+
snowflakeCredentials?: string | undefined;
|
|
3
|
+
}, any>;
|
|
4
|
+
export declare const getStatusRollup: import("ai").Tool<{
|
|
5
|
+
snowflakeCredentials?: string | undefined;
|
|
6
|
+
}, any>;
|
|
7
|
+
export declare const getComponentStatus: import("ai").Tool<{
|
|
8
|
+
limit?: number | undefined;
|
|
9
|
+
}, any>;
|
|
10
|
+
export declare const getUnresolvedIncidents: import("ai").Tool<{
|
|
11
|
+
snowflakeCredentials?: string | undefined;
|
|
12
|
+
}, any>;
|
|
13
|
+
export declare const getActiveScheduledMaintenances: import("ai").Tool<{
|
|
14
|
+
snowflakeCredentials?: string | undefined;
|
|
15
|
+
}, any>;
|
|
16
|
+
export declare const getUpcomingScheduledMaintenances: import("ai").Tool<{
|
|
17
|
+
snowflakeCredentials?: string | undefined;
|
|
18
|
+
}, any>;
|
|
19
|
+
export declare const getAllScheduledMaintenances: import("ai").Tool<{
|
|
20
|
+
snowflakeCredentials?: string | undefined;
|
|
21
|
+
}, any>;
|
|
22
|
+
//# sourceMappingURL=status.d.ts.map
|