@rnsk/toolkits 0.0.5 → 0.0.6

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 (52) hide show
  1. package/README.md +13 -8
  2. package/dist/core/index.d.ts +1 -1
  3. package/dist/core/types.d.ts +43 -1
  4. package/dist/core/validate.d.ts +1 -1
  5. package/dist/core/validate.js +14 -2
  6. package/dist/index.d.ts +3 -1
  7. package/dist/index.js +5 -1
  8. package/dist/toolkits/aws/icon.d.ts +5 -0
  9. package/dist/toolkits/aws/icon.js +41 -0
  10. package/dist/toolkits/aws/manifest.d.ts +3 -0
  11. package/dist/toolkits/aws/manifest.js +27 -0
  12. package/dist/toolkits/aws/tools/client.d.ts +13 -0
  13. package/dist/toolkits/aws/tools/client.js +25 -0
  14. package/dist/toolkits/aws/tools/cloudwatch/filter-log-events.d.ts +26 -0
  15. package/dist/toolkits/aws/tools/cloudwatch/filter-log-events.js +45 -0
  16. package/dist/toolkits/aws/tools/cloudwatch/get-metric-data.d.ts +35 -0
  17. package/dist/toolkits/aws/tools/cloudwatch/get-metric-data.js +62 -0
  18. package/dist/toolkits/aws/tools/cloudwatch/list-alarms.d.ts +29 -0
  19. package/dist/toolkits/aws/tools/cloudwatch/list-alarms.js +46 -0
  20. package/dist/toolkits/aws/tools/cloudwatch/list-log-groups.d.ts +25 -0
  21. package/dist/toolkits/aws/tools/cloudwatch/list-log-groups.js +38 -0
  22. package/dist/toolkits/aws/tools/ec2/get-instance.d.ts +65 -0
  23. package/dist/toolkits/aws/tools/ec2/get-instance.js +46 -0
  24. package/dist/toolkits/aws/tools/ec2/list-instances.d.ts +30 -0
  25. package/dist/toolkits/aws/tools/ec2/list-instances.js +46 -0
  26. package/dist/toolkits/aws/tools/ec2/start-instance.d.ts +24 -0
  27. package/dist/toolkits/aws/tools/ec2/start-instance.js +31 -0
  28. package/dist/toolkits/aws/tools/ec2/stop-instance.d.ts +24 -0
  29. package/dist/toolkits/aws/tools/ec2/stop-instance.js +31 -0
  30. package/dist/toolkits/aws/tools/index.d.ts +273 -0
  31. package/dist/toolkits/aws/tools/index.js +68 -0
  32. package/dist/toolkits/gcp/icon.d.ts +5 -0
  33. package/dist/toolkits/gcp/icon.js +5 -0
  34. package/dist/toolkits/gcp/manifest.d.ts +3 -0
  35. package/dist/toolkits/gcp/manifest.js +27 -0
  36. package/dist/toolkits/gcp/tools/client.d.ts +12 -0
  37. package/dist/toolkits/gcp/tools/client.js +24 -0
  38. package/dist/toolkits/gcp/tools/compute/get-instance.d.ts +36 -0
  39. package/dist/toolkits/gcp/tools/compute/get-instance.js +37 -0
  40. package/dist/toolkits/gcp/tools/compute/list-instances.d.ts +20 -0
  41. package/dist/toolkits/gcp/tools/compute/list-instances.js +62 -0
  42. package/dist/toolkits/gcp/tools/compute/start-instance.d.ts +27 -0
  43. package/dist/toolkits/gcp/tools/compute/start-instance.js +29 -0
  44. package/dist/toolkits/gcp/tools/compute/stop-instance.d.ts +27 -0
  45. package/dist/toolkits/gcp/tools/compute/stop-instance.js +29 -0
  46. package/dist/toolkits/gcp/tools/index.d.ts +162 -0
  47. package/dist/toolkits/gcp/tools/index.js +52 -0
  48. package/dist/toolkits/gcp/tools/monitoring/get-metrics.d.ts +26 -0
  49. package/dist/toolkits/gcp/tools/monitoring/get-metrics.js +53 -0
  50. package/dist/toolkits/gcp/tools/monitoring/list-metric-descriptors.d.ts +24 -0
  51. package/dist/toolkits/gcp/tools/monitoring/list-metric-descriptors.js +40 -0
  52. package/package.json +6 -1
@@ -0,0 +1,162 @@
1
+ import { gcpListComputeInstances } from './compute/list-instances.js';
2
+ import { gcpGetComputeInstance } from './compute/get-instance.js';
3
+ import { gcpStartComputeInstance } from './compute/start-instance.js';
4
+ import { gcpStopComputeInstance } from './compute/stop-instance.js';
5
+ import { gcpGetMonitoringMetrics } from './monitoring/get-metrics.js';
6
+ import { gcpListMonitoringMetricDescriptors } from './monitoring/list-metric-descriptors.js';
7
+ export { gcpListComputeInstances, gcpGetComputeInstance, gcpStartComputeInstance, gcpStopComputeInstance, gcpGetMonitoringMetrics, gcpListMonitoringMetricDescriptors, };
8
+ export declare const gcpTools: ({
9
+ name: string;
10
+ description: string;
11
+ tool: import("ai").Tool<{
12
+ gcpCredentials?: string | undefined;
13
+ zone?: string | undefined;
14
+ }, {
15
+ error: string;
16
+ count?: undefined;
17
+ instances?: undefined;
18
+ message?: undefined;
19
+ } | {
20
+ count: number;
21
+ instances: Record<string, unknown>[];
22
+ error?: undefined;
23
+ message?: undefined;
24
+ } | {
25
+ error: string;
26
+ message: string;
27
+ count?: undefined;
28
+ instances?: undefined;
29
+ }>;
30
+ requiredAuth: "gcpCredentials";
31
+ scope: "read";
32
+ } | {
33
+ name: string;
34
+ description: string;
35
+ tool: import("ai").Tool<{
36
+ zone: string;
37
+ instance: string;
38
+ gcpCredentials?: string | undefined;
39
+ }, {
40
+ error: string;
41
+ name?: undefined;
42
+ zone?: undefined;
43
+ status?: undefined;
44
+ machineType?: undefined;
45
+ privateIp?: undefined;
46
+ publicIp?: undefined;
47
+ creationTimestamp?: undefined;
48
+ message?: undefined;
49
+ } | {
50
+ name: string | null | undefined;
51
+ zone: string;
52
+ status: string | null | undefined;
53
+ machineType: string | undefined;
54
+ privateIp: string | null | undefined;
55
+ publicIp: string | null | undefined;
56
+ creationTimestamp: string | null | undefined;
57
+ error?: undefined;
58
+ message?: undefined;
59
+ } | {
60
+ error: string;
61
+ message: string;
62
+ name?: undefined;
63
+ zone?: undefined;
64
+ status?: undefined;
65
+ machineType?: undefined;
66
+ privateIp?: undefined;
67
+ publicIp?: undefined;
68
+ creationTimestamp?: undefined;
69
+ }>;
70
+ requiredAuth: "gcpCredentials";
71
+ scope: "read";
72
+ } | {
73
+ name: string;
74
+ description: string;
75
+ tool: import("ai").Tool<{
76
+ zone: string;
77
+ instance: string;
78
+ gcpCredentials?: string | undefined;
79
+ }, {
80
+ error: string;
81
+ instance?: undefined;
82
+ zone?: undefined;
83
+ operation?: undefined;
84
+ status?: undefined;
85
+ message?: undefined;
86
+ } | {
87
+ instance: string;
88
+ zone: string;
89
+ operation: string | undefined;
90
+ status: string;
91
+ error?: undefined;
92
+ message?: undefined;
93
+ } | {
94
+ error: string;
95
+ message: string;
96
+ instance?: undefined;
97
+ zone?: undefined;
98
+ operation?: undefined;
99
+ status?: undefined;
100
+ }>;
101
+ requiredAuth: "gcpCredentials";
102
+ scope: "write";
103
+ } | {
104
+ name: string;
105
+ description: string;
106
+ tool: import("ai").Tool<{
107
+ filter: string;
108
+ startTime?: string | undefined;
109
+ endTime?: string | undefined;
110
+ gcpCredentials?: string | undefined;
111
+ }, {
112
+ error: string;
113
+ timeSeries?: undefined;
114
+ message?: undefined;
115
+ } | {
116
+ timeSeries: {
117
+ metric: import("@google-cloud/monitoring/build/protos/protos.js").google.api.IMetric | null | undefined;
118
+ resource: import("@google-cloud/monitoring/build/protos/protos.js").google.api.IMonitoredResource | null | undefined;
119
+ points: {
120
+ value: import("@google-cloud/monitoring/build/protos/protos.js").google.monitoring.v3.ITypedValue | null | undefined;
121
+ interval: import("@google-cloud/monitoring/build/protos/protos.js").google.monitoring.v3.ITimeInterval | null | undefined;
122
+ }[];
123
+ }[];
124
+ error?: undefined;
125
+ message?: undefined;
126
+ } | {
127
+ error: string;
128
+ message: string;
129
+ timeSeries?: undefined;
130
+ }>;
131
+ requiredAuth: "gcpCredentials";
132
+ scope: "read";
133
+ } | {
134
+ name: string;
135
+ description: string;
136
+ tool: import("ai").Tool<{
137
+ filter?: string | undefined;
138
+ gcpCredentials?: string | undefined;
139
+ }, {
140
+ error: string;
141
+ descriptors?: undefined;
142
+ message?: undefined;
143
+ } | {
144
+ descriptors: {
145
+ type: string | null | undefined;
146
+ displayName: string | null | undefined;
147
+ description: string | null | undefined;
148
+ metricKind: import("@google-cloud/monitoring/build/protos/protos.js").google.api.MetricDescriptor.MetricKind | "METRIC_KIND_UNSPECIFIED" | "GAUGE" | "DELTA" | "CUMULATIVE" | null | undefined;
149
+ valueType: import("@google-cloud/monitoring/build/protos/protos.js").google.api.MetricDescriptor.ValueType | "VALUE_TYPE_UNSPECIFIED" | "BOOL" | "INT64" | "DOUBLE" | "STRING" | "DISTRIBUTION" | "MONEY" | null | undefined;
150
+ unit: string | null | undefined;
151
+ }[];
152
+ error?: undefined;
153
+ message?: undefined;
154
+ } | {
155
+ error: string;
156
+ message: string;
157
+ descriptors?: undefined;
158
+ }>;
159
+ requiredAuth: "gcpCredentials";
160
+ scope: "read";
161
+ })[];
162
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,52 @@
1
+ import { gcpListComputeInstances } from './compute/list-instances.js';
2
+ import { gcpGetComputeInstance } from './compute/get-instance.js';
3
+ import { gcpStartComputeInstance } from './compute/start-instance.js';
4
+ import { gcpStopComputeInstance } from './compute/stop-instance.js';
5
+ import { gcpGetMonitoringMetrics } from './monitoring/get-metrics.js';
6
+ import { gcpListMonitoringMetricDescriptors } from './monitoring/list-metric-descriptors.js';
7
+ export { gcpListComputeInstances, gcpGetComputeInstance, gcpStartComputeInstance, gcpStopComputeInstance, gcpGetMonitoringMetrics, gcpListMonitoringMetricDescriptors, };
8
+ export const gcpTools = [
9
+ {
10
+ name: 'gcpListComputeInstances',
11
+ description: 'List Compute Engine instances, optionally filtered by zone.',
12
+ tool: gcpListComputeInstances,
13
+ requiredAuth: 'gcpCredentials',
14
+ scope: 'read',
15
+ },
16
+ {
17
+ name: 'gcpGetComputeInstance',
18
+ description: 'Get details about a specific Compute Engine instance.',
19
+ tool: gcpGetComputeInstance,
20
+ requiredAuth: 'gcpCredentials',
21
+ scope: 'read',
22
+ },
23
+ {
24
+ name: 'gcpStartComputeInstance',
25
+ description: 'Start a stopped Compute Engine instance.',
26
+ tool: gcpStartComputeInstance,
27
+ requiredAuth: 'gcpCredentials',
28
+ scope: 'write',
29
+ },
30
+ {
31
+ name: 'gcpStopComputeInstance',
32
+ description: 'Stop a running Compute Engine instance.',
33
+ tool: gcpStopComputeInstance,
34
+ requiredAuth: 'gcpCredentials',
35
+ scope: 'write',
36
+ },
37
+ {
38
+ name: 'gcpGetMonitoringMetrics',
39
+ description: 'Retrieve Cloud Monitoring time series data for a metric filter.',
40
+ tool: gcpGetMonitoringMetrics,
41
+ requiredAuth: 'gcpCredentials',
42
+ scope: 'read',
43
+ },
44
+ {
45
+ name: 'gcpListMonitoringMetricDescriptors',
46
+ description: 'List available Cloud Monitoring metric descriptors.',
47
+ tool: gcpListMonitoringMetricDescriptors,
48
+ requiredAuth: 'gcpCredentials',
49
+ scope: 'read',
50
+ },
51
+ ];
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,26 @@
1
+ export declare const gcpGetMonitoringMetrics: import("ai").Tool<{
2
+ filter: string;
3
+ startTime?: string | undefined;
4
+ endTime?: string | undefined;
5
+ gcpCredentials?: string | undefined;
6
+ }, {
7
+ error: string;
8
+ timeSeries?: undefined;
9
+ message?: undefined;
10
+ } | {
11
+ timeSeries: {
12
+ metric: import("@google-cloud/monitoring/build/protos/protos.js").google.api.IMetric | null | undefined;
13
+ resource: import("@google-cloud/monitoring/build/protos/protos.js").google.api.IMonitoredResource | null | undefined;
14
+ points: {
15
+ value: import("@google-cloud/monitoring/build/protos/protos.js").google.monitoring.v3.ITypedValue | null | undefined;
16
+ interval: import("@google-cloud/monitoring/build/protos/protos.js").google.monitoring.v3.ITimeInterval | null | undefined;
17
+ }[];
18
+ }[];
19
+ error?: undefined;
20
+ message?: undefined;
21
+ } | {
22
+ error: string;
23
+ message: string;
24
+ timeSeries?: undefined;
25
+ }>;
26
+ //# sourceMappingURL=get-metrics.d.ts.map
@@ -0,0 +1,53 @@
1
+ import { tool } from 'ai';
2
+ import { z } from 'zod';
3
+ import { createMonitoringClient, getProjectId } from '../client.js';
4
+ export const gcpGetMonitoringMetrics = tool({
5
+ description: 'Retrieve Cloud Monitoring time series data for a metric filter (e.g. compute.googleapis.com/instance/cpu/utilization). Use this to check resource health or usage trends.',
6
+ inputSchema: z.object({
7
+ gcpCredentials: z.string().optional().describe('Injected by system; do not provide'),
8
+ filter: z
9
+ .string()
10
+ .describe('Monitoring filter, e.g. \'metric.type="compute.googleapis.com/instance/cpu/utilization"\''),
11
+ startTime: z.string().optional().describe('Start time in ISO 8601 format (default: 1 hour ago)'),
12
+ endTime: z.string().optional().describe('End time in ISO 8601 format (default: now)'),
13
+ }),
14
+ execute: async ({ gcpCredentials, filter, startTime, endTime }) => {
15
+ if (!gcpCredentials) {
16
+ return { error: 'GCP credentials are required. Connect GCP first.' };
17
+ }
18
+ try {
19
+ const client = createMonitoringClient(gcpCredentials);
20
+ const projectId = getProjectId(gcpCredentials);
21
+ const [timeSeries] = await client.listTimeSeries({
22
+ name: `projects/${projectId}`,
23
+ filter,
24
+ interval: {
25
+ startTime: {
26
+ seconds: startTime ? Math.floor(new Date(startTime).getTime() / 1000) : Math.floor(Date.now() / 1000) - 3600,
27
+ },
28
+ endTime: {
29
+ seconds: endTime ? Math.floor(new Date(endTime).getTime() / 1000) : Math.floor(Date.now() / 1000),
30
+ },
31
+ },
32
+ view: 'FULL',
33
+ });
34
+ return {
35
+ timeSeries: (timeSeries ?? []).map((series) => ({
36
+ metric: series.metric,
37
+ resource: series.resource,
38
+ points: (series.points ?? []).map((point) => ({
39
+ value: point.value,
40
+ interval: point.interval,
41
+ })),
42
+ })),
43
+ };
44
+ }
45
+ catch (err) {
46
+ return {
47
+ error: 'Failed to get Cloud Monitoring metrics',
48
+ message: err instanceof Error ? err.message : 'Unknown error',
49
+ };
50
+ }
51
+ },
52
+ });
53
+ //# sourceMappingURL=get-metrics.js.map
@@ -0,0 +1,24 @@
1
+ export declare const gcpListMonitoringMetricDescriptors: import("ai").Tool<{
2
+ filter?: string | undefined;
3
+ gcpCredentials?: string | undefined;
4
+ }, {
5
+ error: string;
6
+ descriptors?: undefined;
7
+ message?: undefined;
8
+ } | {
9
+ descriptors: {
10
+ type: string | null | undefined;
11
+ displayName: string | null | undefined;
12
+ description: string | null | undefined;
13
+ metricKind: import("@google-cloud/monitoring/build/protos/protos.js").google.api.MetricDescriptor.MetricKind | "METRIC_KIND_UNSPECIFIED" | "GAUGE" | "DELTA" | "CUMULATIVE" | null | undefined;
14
+ valueType: import("@google-cloud/monitoring/build/protos/protos.js").google.api.MetricDescriptor.ValueType | "VALUE_TYPE_UNSPECIFIED" | "BOOL" | "INT64" | "DOUBLE" | "STRING" | "DISTRIBUTION" | "MONEY" | null | undefined;
15
+ unit: string | null | undefined;
16
+ }[];
17
+ error?: undefined;
18
+ message?: undefined;
19
+ } | {
20
+ error: string;
21
+ message: string;
22
+ descriptors?: undefined;
23
+ }>;
24
+ //# sourceMappingURL=list-metric-descriptors.d.ts.map
@@ -0,0 +1,40 @@
1
+ import { tool } from 'ai';
2
+ import { z } from 'zod';
3
+ import { createMonitoringClient, getProjectId } from '../client.js';
4
+ export const gcpListMonitoringMetricDescriptors = tool({
5
+ description: 'List available Cloud Monitoring metric descriptors, optionally filtered by metric type.',
6
+ inputSchema: z.object({
7
+ gcpCredentials: z.string().optional().describe('Injected by system; do not provide'),
8
+ filter: z.string().optional().describe('Optional filter for metric type, e.g. \'metric.type = starts_with("compute")\''),
9
+ }),
10
+ execute: async ({ gcpCredentials, filter }) => {
11
+ if (!gcpCredentials) {
12
+ return { error: 'GCP credentials are required. Connect GCP first.' };
13
+ }
14
+ try {
15
+ const client = createMonitoringClient(gcpCredentials);
16
+ const projectId = getProjectId(gcpCredentials);
17
+ const [descriptors] = await client.listMetricDescriptors({
18
+ name: `projects/${projectId}`,
19
+ filter,
20
+ });
21
+ return {
22
+ descriptors: (descriptors ?? []).map((descriptor) => ({
23
+ type: descriptor.type,
24
+ displayName: descriptor.displayName,
25
+ description: descriptor.description,
26
+ metricKind: descriptor.metricKind,
27
+ valueType: descriptor.valueType,
28
+ unit: descriptor.unit,
29
+ })),
30
+ };
31
+ }
32
+ catch (err) {
33
+ return {
34
+ error: 'Failed to list Cloud Monitoring metric descriptors',
35
+ message: err instanceof Error ? err.message : 'Unknown error',
36
+ };
37
+ }
38
+ },
39
+ });
40
+ //# sourceMappingURL=list-metric-descriptors.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnsk/toolkits",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Runstack toolkit registry — manifest-driven tool definitions for AI agents",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -32,6 +32,11 @@
32
32
  "zod": "^3.23.0 || ^4.0.0"
33
33
  },
34
34
  "dependencies": {
35
+ "@aws-sdk/client-cloudwatch": "^3.1134.0",
36
+ "@aws-sdk/client-cloudwatch-logs": "^3.1134.0",
37
+ "@aws-sdk/client-ec2": "^3.1134.0",
38
+ "@google-cloud/compute": "^7.4.0",
39
+ "@google-cloud/monitoring": "^6.1.0",
35
40
  "firecrawl": "^4.38.0",
36
41
  "octokit": "^5.0.5",
37
42
  "zod-to-json-schema": "^3.25.2"