@anthonyhaussman/opencode-agy-auth 1.2.16-alpha.0 → 1.2.16-alpha.2
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 +13 -7
- package/dist/index.d.ts +6 -5
- package/dist/index.js +946 -110
- package/dist/index.js.map +1 -1
- package/dist/src/constants.d.ts +2 -0
- package/dist/src/plugin/headers.d.ts +7 -0
- package/dist/src/plugin/oauth-authorize.d.ts +9 -0
- package/dist/src/plugin/quota-summary.d.ts +2 -0
- package/dist/src/plugin/quota.d.ts +2 -0
- package/dist/src/plugin/tier.d.ts +28 -0
- package/dist/src/plugin/types.d.ts +35 -0
- package/dist/src/plugin/v2-fetch.d.ts +1 -0
- package/dist/src/plugin/v2-session.d.ts +7 -0
- package/dist/src/plugin/v2-storage.d.ts +3 -0
- package/dist/src/plugin/v2.d.ts +14 -0
- package/dist/src/plugin.d.ts +2 -0
- package/dist/src/sdk/request/prepare.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ An [OpenCode](https://opencode.ai/) authentication plugin that enables seamless
|
|
|
14
14
|
- **Dynamic Model Retrieval**: Fetches available models based on user tier and current allocations.
|
|
15
15
|
- **Quota Tracking**: Injects the `agy_quota` tool into OpenCode to check usage limits directly.
|
|
16
16
|
- **Traffic Simulation**: Maintains background heartbeat with `agy` servers.
|
|
17
|
+
- **Dual OpenCode Compatibility**: Natively supports both OpenCode v1 (>= 1.18.29) and OpenCode v2 out of the box without breaking changes.
|
|
17
18
|
|
|
18
19
|
## Installation
|
|
19
20
|
|
|
@@ -144,9 +145,18 @@ To test and develop the plugin locally with OpenCode before publishing:
|
|
|
144
145
|
3. **Verify the plugin**:
|
|
145
146
|
Launch OpenCode in your target project. OpenCode will automatically resolve and load your local plugin directory. You can test your changes by running `npm run build` in the plugin directory and restarting your OpenCode session.
|
|
146
147
|
|
|
147
|
-
##
|
|
148
|
+
## OpenCode Runtime Compatibility
|
|
148
149
|
|
|
149
|
-
|
|
150
|
+
The plugin natively supports both OpenCode v1 (>= 1.18.29) and [OpenCode v2](https://opencode.ai/v2/docs) out of the box through a dual-compatibility architecture:
|
|
151
|
+
|
|
152
|
+
- **OpenCode v1**: Loaded via the `server(options)` hook with custom OAuth flow and provider setup.
|
|
153
|
+
- **OpenCode v2**: Loaded via `Plugin.define` / `setup(ctx)` with native catalog transformations, AI SDK hooks, session interception, and PKCE OAuth integration.
|
|
154
|
+
|
|
155
|
+
No special flags or configurations are required - the plugin detects runtime automatically.
|
|
156
|
+
|
|
157
|
+
## Pre-release Channel
|
|
158
|
+
|
|
159
|
+
To test bleeding-edge features or upcoming changes before official releases, configure the `@alpha` distribution tag:
|
|
150
160
|
|
|
151
161
|
```bash
|
|
152
162
|
npm install @anthonyhaussman/opencode-agy-auth@alpha
|
|
@@ -160,12 +170,8 @@ Or configure it directly in your `opencode.json`:
|
|
|
160
170
|
}
|
|
161
171
|
```
|
|
162
172
|
|
|
163
|
-
### OpenCode v2 Compatibility
|
|
164
|
-
|
|
165
|
-
The `@alpha` channel provides dual compatibility with both OpenCode v1 and [OpenCode v2](https://opencode.ai/v2/docs), supporting the new v2 plugin architecture, unified hooks, and OAuth credential handling while maintaining full backward compatibility.
|
|
166
|
-
|
|
167
173
|
> [!WARNING]
|
|
168
|
-
> **Instability Warning**: The `@alpha` release contains experimental features
|
|
174
|
+
> **Instability Warning**: The `@alpha` release contains experimental features and active development builds. It may be unstable or cause disruptions in session authentication and model requests. Use only for testing and development. For day-to-day work, use the stable release.
|
|
169
175
|
|
|
170
176
|
## Star History & Support
|
|
171
177
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AgyCLIOAuthPlugin, GoogleOAuthPlugin } from "./src/plugin";
|
|
2
|
+
import { setupOpenCodeV2, v2PluginDefinition } from "./src/plugin/v2";
|
|
3
|
+
import type { DualOpenCodePlugin } from "./src/plugin/types";
|
|
2
4
|
export { AgyCLIOAuthPlugin, GoogleOAuthPlugin };
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default _default;
|
|
5
|
+
export { setupOpenCodeV2, v2PluginDefinition };
|
|
6
|
+
export * from "./src/plugin/types";
|
|
7
|
+
declare const dualPlugin: DualOpenCodePlugin;
|
|
8
|
+
export default dualPlugin;
|