opencode-antigravity-img 0.1.0 → 0.1.1

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.
@@ -0,0 +1,15 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: [ominiverdi] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: # Replace with a single Ko-fi username
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12
+ polar: # Replace with a single Polar username
13
+ buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14
+ thanks_dev: # Replace with a single thanks.dev username
15
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lorenzo Becchi (ominiverdi)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # opencode-antigravity-img
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/opencode-antigravity-img.svg)](https://www.npmjs.com/package/opencode-antigravity-img)
4
+ [![npm downloads](https://img.shields.io/npm/dm/opencode-antigravity-img.svg)](https://www.npmjs.com/package/opencode-antigravity-img)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
3
7
  OpenCode plugin for generating images using Gemini 3 Pro Image model via Google's Antigravity/CloudCode API.
4
8
 
5
9
  ## Requirements
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-antigravity-img",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "OpenCode plugin for Gemini image generation via Antigravity/CloudCode API",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
package/src/constants.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { homedir } from "os";
2
2
  import { join } from "path";
3
+ import { platform } from "process";
3
4
 
4
5
  // OAuth credentials (same as antigravity-auth plugin)
5
6
  export const ANTIGRAVITY_CLIENT_ID = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com";
@@ -24,14 +25,23 @@ export const CLOUDCODE_METADATA = {
24
25
  export const IMAGE_MODEL = "gemini-3-pro-image";
25
26
  export const IMAGE_GENERATION_TIMEOUT_MS = 120_000;
26
27
 
27
- // Config file paths
28
+ // Config directory (match opencode-antigravity-auth behavior)
29
+ function getConfigDir(): string {
30
+ if (platform === "win32") {
31
+ return join(process.env.APPDATA || join(homedir(), "AppData", "Roaming"), "opencode");
32
+ }
33
+ const xdgConfig = process.env.XDG_CONFIG_HOME || join(homedir(), ".config");
34
+ return join(xdgConfig, "opencode");
35
+ }
36
+
37
+ // Config file paths (primary path matches auth plugin, fallback for legacy)
28
38
  export const CONFIG_PATHS = [
29
- join(homedir(), ".config", "opencode", "antigravity-accounts.json"),
39
+ join(getConfigDir(), "antigravity-accounts.json"),
30
40
  join(homedir(), ".opencode", "antigravity-accounts.json"),
31
41
  ];
32
42
 
33
43
  // Command file for opencode discovery
34
- export const COMMAND_DIR = join(homedir(), ".config", "opencode", "commands");
44
+ export const COMMAND_DIR = join(getConfigDir(), "commands");
35
45
  export const COMMAND_FILE = join(COMMAND_DIR, "generate-image.md");
36
46
  export const COMMAND_CONTENT = `# Generate Image
37
47