@opentabs-dev/opentabs-plugin-google-cloud 0.0.76 → 0.0.77

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 CHANGED
@@ -1,159 +1,115 @@
1
- # opentabs-plugin-google-cloud
1
+ # Google Cloud
2
2
 
3
- OpenTabs plugin for Google Cloud Console
3
+ OpenTabs plugin for Google Cloud Console — gives AI agents access to Google Cloud through your authenticated browser session.
4
4
 
5
- ## Project Structure
5
+ ## Install
6
6
 
7
- ```
8
- google-cloud/
9
- ├── package.json # Plugin metadata (name, opentabs field, dependencies)
10
- ├── icon.svg # Optional custom icon (square SVG, max 8KB)
11
- ├── icon-inactive.svg # Optional manual inactive icon override
12
- ├── src/
13
- │ ├── index.ts # Plugin class (extends OpenTabsPlugin)
14
- │ └── tools/ # One file per tool (using defineTool)
15
- │ └── example.ts
16
- └── dist/ # Build output (generated)
17
- ├── adapter.iife.js # Bundled adapter injected into matching tabs
18
- └── tools.json # Tool schemas for MCP registration
7
+ ```bash
8
+ opentabs plugin install google-cloud
19
9
  ```
20
10
 
21
- ## Configuration
11
+ Or install globally via npm:
22
12
 
23
- Plugin metadata is defined in `package.json` under the `opentabs` field:
24
-
25
- ```json
26
- {
27
- "name": "opentabs-plugin-google-cloud",
28
- "main": "dist/adapter.iife.js",
29
- "opentabs": {
30
- "displayName": "Google Cloud",
31
- "description": "OpenTabs plugin for Google Cloud Console",
32
- "urlPatterns": ["*://*.console.cloud.google.com/*"]
33
- }
34
- }
13
+ ```bash
14
+ npm install -g @opentabs-dev/opentabs-plugin-google-cloud
35
15
  ```
36
16
 
37
- - **`main`** — entry point for the bundled adapter IIFE
38
- - **`opentabs.displayName`** — human-readable name shown in the side panel
39
- - **`opentabs.description`** — short description of what the plugin does
40
- - **`opentabs.urlPatterns`** — Chrome match patterns for tabs where the adapter is injected
17
+ ## Setup
41
18
 
42
- ## Custom Icons
19
+ 1. Open [console.cloud.google.com](https://console.cloud.google.com) in Chrome and log in
20
+ 2. Open the OpenTabs side panel — the Google Cloud plugin should appear as **ready**
43
21
 
44
- By default, the side panel shows a colored letter avatar for your plugin. To use a custom icon, place an `icon.svg` file in the plugin root (next to `package.json`):
22
+ ## Tools (30)
45
23
 
46
- ```
47
- google-cloud/
48
- ├── package.json
49
- ├── icon.svg ← custom icon (optional)
50
- ├── icon-inactive.svg ← manual inactive override (optional, requires icon.svg)
51
- ├── src/
52
- │ └── ...
53
- ```
24
+ ### Projects (3)
54
25
 
55
- **How it works:**
26
+ | Tool | Description | Type |
27
+ |---|---|---|
28
+ | `get_current_project` | Get the active project from the console URL | Read |
29
+ | `list_projects` | List accessible GCP projects | Read |
30
+ | `get_project` | Get details about a GCP project | Read |
56
31
 
57
- - `opentabs-plugin build` reads `icon.svg`, validates it, auto-generates a grayscale inactive variant, and embeds both in `dist/tools.json`
58
- - To override the auto-generated inactive icon, provide `icon-inactive.svg` (must use only grayscale colors)
59
- - If no `icon.svg` is provided, the letter avatar is used automatically
32
+ ### Compute (7)
60
33
 
61
- **Icon requirements:**
34
+ | Tool | Description | Type |
35
+ |---|---|---|
36
+ | `list_instances` | List Compute Engine VM instances | Read |
37
+ | `get_instance` | Get a Compute Engine VM instance | Read |
38
+ | `start_instance` | Start a stopped VM instance | Write |
39
+ | `stop_instance` | Stop a running VM instance | Write |
40
+ | `list_disks` | List persistent disks | Read |
41
+ | `list_networks` | List VPC networks | Read |
42
+ | `list_firewalls` | List firewall rules | Read |
62
43
 
63
- - Square SVG with a `viewBox` attribute (e.g., `viewBox="0 0 32 32"`)
64
- - Maximum 8 KB file size
65
- - No embedded `<image>`, `<script>`, or event handler attributes (`onclick`, etc.)
66
- - Manual `icon-inactive.svg` must use only achromatic (grayscale) colors
44
+ ### Storage (3)
67
45
 
68
- ## Development
46
+ | Tool | Description | Type |
47
+ |---|---|---|
48
+ | `list_buckets` | List Cloud Storage buckets | Read |
49
+ | `get_bucket` | Get a Cloud Storage bucket | Read |
50
+ | `list_objects` | List objects in a storage bucket | Read |
69
51
 
70
- ```bash
71
- npm install
72
- npm run build # tsc && opentabs-plugin build
73
- npm run dev # watch mode (tsc --watch + opentabs-plugin build --watch)
74
- npm run type-check # tsc --noEmit
75
- npm run lint # biome
76
- ```
52
+ ### IAM (3)
77
53
 
78
- ## Adding Tools
79
-
80
- Create a new file in `src/tools/` using `defineTool`:
81
-
82
- ```ts
83
- import { z } from 'zod';
84
- import { defineTool } from '@opentabs-dev/plugin-sdk';
85
-
86
- export const myTool = defineTool({
87
- name: 'my_tool',
88
- displayName: 'My Tool',
89
- description: 'What this tool does',
90
- icon: 'wrench',
91
- input: z.object({ /* ... */ }),
92
- output: z.object({ /* ... */ }),
93
- handle: async (params) => {
94
- // Tool implementation runs in the browser tab context
95
- return { /* ... */ };
96
- },
97
- });
98
- ```
54
+ | Tool | Description | Type |
55
+ |---|---|---|
56
+ | `list_service_accounts` | List IAM service accounts | Read |
57
+ | `list_iam_roles` | List custom IAM roles | Read |
58
+ | `get_iam_policy` | Get the project IAM policy | Read |
99
59
 
100
- Then register it in `src/index.ts` by adding it to the `tools` array.
60
+ ### Services (3)
101
61
 
102
- ## Authentication
62
+ | Tool | Description | Type |
63
+ |---|---|---|
64
+ | `list_enabled_services` | List enabled API services | Read |
65
+ | `enable_service` | Enable a GCP API service | Write |
66
+ | `disable_service` | Disable a GCP API service | Write |
103
67
 
104
- Plugin tools run in the browser tab context, so they can read auth tokens directly from the page. The SDK provides utilities for the most common patterns:
68
+ ### Cloud Functions (2)
105
69
 
106
- ```ts
107
- import { getLocalStorage, getCookie, getPageGlobal } from '@opentabs-dev/plugin-sdk';
70
+ | Tool | Description | Type |
71
+ |---|---|---|
72
+ | `list_functions` | List Cloud Functions | Read |
73
+ | `get_function` | Get a Cloud Function | Read |
108
74
 
109
- // localStorage most common
110
- const token = getLocalStorage('token');
75
+ ### Cloud Run (2)
111
76
 
112
- // Cookies session tokens, JWTs
113
- const session = getCookie('session_id');
77
+ | Tool | Description | Type |
78
+ |---|---|---|
79
+ | `list_cloud_run_services` | List Cloud Run services | Read |
80
+ | `get_cloud_run_service` | Get a Cloud Run service | Read |
114
81
 
115
- // Page globals — SPA boot data (e.g., window.__APP_STATE__)
116
- const appState = getPageGlobal('__APP_STATE__');
117
- ```
82
+ ### Logging (1)
118
83
 
119
- **Iframe fallback:** Some apps (e.g., Discord) delete `window.localStorage` after boot. `getLocalStorage` automatically tries a hidden same-origin iframe fallback before returning `null`, so you don't need to handle this case manually.
84
+ | Tool | Description | Type |
85
+ |---|---|---|
86
+ | `list_log_entries` | List Cloud Logging entries | Read |
120
87
 
121
- **SPA hydration:** Auth tokens may not be available immediately on page load. Implement polling in `isReady()` to wait until the app has hydrated before your tools run. See the comments in `src/index.ts` for an example polling pattern.
88
+ ### Billing (2)
122
89
 
123
- ## Shared Schemas
90
+ | Tool | Description | Type |
91
+ |---|---|---|
92
+ | `list_billing_accounts` | List billing accounts | Read |
93
+ | `get_billing_info` | Get project billing info | Read |
124
94
 
125
- When 3 or more tools share the same input or output shape, extract common Zod schemas into a shared file to avoid duplication:
95
+ ### Kubernetes (2)
126
96
 
127
- ```ts
128
- // src/schemas/channel.ts
129
- import { z } from 'zod';
97
+ | Tool | Description | Type |
98
+ |---|---|---|
99
+ | `list_clusters` | List GKE clusters | Read |
100
+ | `get_cluster` | Get a GKE cluster | Read |
130
101
 
131
- export const channelSchema = z.object({
132
- id: z.string().describe('Channel ID'),
133
- name: z.string().describe('Channel name'),
134
- });
102
+ ### Cloud SQL (2)
135
103
 
136
- export type Channel = z.infer<typeof channelSchema>;
137
- ```
104
+ | Tool | Description | Type |
105
+ |---|---|---|
106
+ | `list_sql_instances` | List Cloud SQL instances | Read |
107
+ | `get_sql_instance` | Get a Cloud SQL instance | Read |
138
108
 
139
- Then import and reuse in your tools:
140
-
141
- ```ts
142
- // src/tools/list-channels.ts
143
- import { channelSchema } from '../schemas/channel.js';
144
-
145
- export const listChannels = defineTool({
146
- name: 'list_channels',
147
- displayName: 'List Channels',
148
- description: 'List all available channels',
149
- icon: 'list',
150
- input: z.object({}),
151
- output: z.object({ channels: z.array(channelSchema) }),
152
- handle: async () => {
153
- // ...
154
- return { channels: [] };
155
- },
156
- });
157
- ```
109
+ ## How It Works
110
+
111
+ This plugin runs inside your Google Cloud tab through the [OpenTabs](https://opentabs.dev) Chrome extension. It uses your existing browser session — no API tokens or OAuth apps required. All operations happen as you, with your permissions.
112
+
113
+ ## License
158
114
 
159
- This keeps your tool schemas DRY and makes it easy to evolve shared types in one place.
115
+ MIT
@@ -317,6 +317,8 @@
317
317
  * (e.g., 'https://github.com'), not a match pattern.
318
318
  */
319
319
  homepage;
320
+ /** Typed configuration schema — declares settings that users provide via config.json or the side panel. */
321
+ configSchema;
320
322
  };
321
323
 
322
324
  // src/gcloud-api.ts
@@ -15336,7 +15338,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15336
15338
  };
15337
15339
  var src_default = new GoogleCloudPlugin();
15338
15340
 
15339
- // dist/_adapter_entry_310654cf-b318-4bbd-8222-8d8fc74b1385.ts
15341
+ // dist/_adapter_entry_3d02844b-3ae4-4cc9-9d5b-b6c12b02cb22.ts
15340
15342
  if (!globalThis.__openTabs) {
15341
15343
  globalThis.__openTabs = {};
15342
15344
  } else {
@@ -15552,5 +15554,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15552
15554
  };
15553
15555
  delete src_default.onDeactivate;
15554
15556
  }
15555
- })();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["google-cloud"]){var a=o.adapters["google-cloud"];a.__adapterHash="050d761f3b0ded5e806da8ff4b649d8472378835fcf25e3b59bc3cf8648387d7";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"google-cloud",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
15557
+ })();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["google-cloud"]){var a=o.adapters["google-cloud"];a.__adapterHash="ed9aed6bd3a15870378a7f6245753ac7be22b2efcfe61551449cbc5f860caf29";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"google-cloud",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
15556
15558
  //# sourceMappingURL=adapter.iife.js.map