@anthonyhaussman/opencode-agy-auth 1.2.7-alpha.3 → 1.2.7

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.
@@ -1,6 +1,4 @@
1
1
  export declare const AGY_PROVIDER_ID = "google-agy";
2
- export declare const AGY_AUTH_URL = "https://accounts.google.com/o/oauth2/auth";
3
- export declare const AGY_TOKEN_URL = "https://oauth2.googleapis.com/token";
4
2
  export declare const AGY_CLIENT_ID = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com";
5
3
  export declare const AGY_CLIENT_SECRET = "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";
6
4
  export declare const AGY_SCOPES: readonly string[];
@@ -7,18 +7,9 @@ export declare function createOAuthAuthorizeMethod(options?: {
7
7
  client?: PluginClient;
8
8
  getConfiguredProjectId?: () => Promise<string | undefined> | string | undefined;
9
9
  getUserAgentModel?: () => Promise<string | undefined> | string | undefined;
10
- openBrowser?: (url: string) => void;
11
10
  }): () => Promise<{
12
11
  url: string;
13
12
  instructions: string;
14
13
  method: 'code';
15
14
  callback: (callbackUrl: string) => Promise<AgyTokenExchangeResult>;
16
15
  }>;
17
- export declare function parseOAuthCallbackInput(input: string): {
18
- code?: string;
19
- state?: string;
20
- };
21
- export declare function setOpenBrowserLauncherForTesting(launcher: typeof openBrowserLauncher | null): void;
22
- export declare function defaultOpenBrowserLauncher(command: string, args: string[]): void;
23
- declare let openBrowserLauncher: typeof defaultOpenBrowserLauncher;
24
- export {};
@@ -1,7 +1,5 @@
1
1
  import type { GetAuth, PluginClient } from "./types";
2
2
  export declare const AGY_QUOTA_SUMMARY_TOOL_NAME = "agy_quota_summary";
3
- export declare const AGY_V2_QUOTA_SUMMARY_COMMAND = "agy-quota-summary";
4
- export declare const AGY_V2_QUOTA_SUMMARY_COMMAND_TEMPLATE = "Retrieve Agy Code Assist quota summary (weekly and 5-hour limits by model group) for the current authenticated account.\n\nImmediately call `agy_quota_summary` with no arguments and return its output verbatim.\nDo not call other tools.\n";
5
3
  interface AgyQuotaSummaryToolDependencies {
6
4
  client: PluginClient;
7
5
  getAuthResolver: () => GetAuth | undefined;
@@ -1,7 +1,5 @@
1
1
  import type { GetAuth, PluginClient } from "./types";
2
2
  export declare const AGY_QUOTA_TOOL_NAME = "agy_quota";
3
- export declare const AGY_V2_QUOTA_COMMAND = "agy-quota";
4
- export declare const AGY_V2_QUOTA_COMMAND_TEMPLATE = "Retrieve Agy Code Assist quota usage for the current authenticated account.\n\nImmediately call `agy_quota` with no arguments and return its output verbatim.\nDo not call other tools.\n";
5
3
  interface AgyQuotaToolDependencies {
6
4
  client: PluginClient;
7
5
  getAuthResolver: () => GetAuth | undefined;
@@ -29,38 +29,3 @@ export interface ProjectContextResult {
29
29
  effectiveProjectId: string;
30
30
  }
31
31
  export type { Provider as ProviderV2, Model as ModelV2 } from '@opencode-ai/sdk/v2';
32
- export interface OpenCodeV2TransformRegistry<T = any> {
33
- transform: (fn: (target: T) => Promise<void> | void) => void;
34
- }
35
- export interface OpenCodeV2SessionRegistry {
36
- hook: (name: string, handler: (...args: any[]) => any, options?: {
37
- providerID?: string;
38
- }) => void;
39
- }
40
- export interface OpenCodeV2PluginLocation {
41
- root?: string;
42
- workspace?: string;
43
- }
44
- export interface OpenCodeV2PluginContext {
45
- catalog?: OpenCodeV2TransformRegistry;
46
- provider?: OpenCodeV2TransformRegistry;
47
- model?: OpenCodeV2TransformRegistry;
48
- tool: OpenCodeV2TransformRegistry;
49
- command: OpenCodeV2TransformRegistry;
50
- session: OpenCodeV2SessionRegistry;
51
- aisdk?: {
52
- hook: (name: 'sdk' | 'language', handler: (event: any) => Promise<void> | void) => void;
53
- };
54
- integration?: OpenCodeV2TransformRegistry | {
55
- transform?: (transformer: (editor: any) => void) => void;
56
- };
57
- location: OpenCodeV2PluginLocation;
58
- }
59
- export interface OpenCodeV2PluginDefinition {
60
- id: string;
61
- setup: (ctx: OpenCodeV2PluginContext) => Promise<void> | void;
62
- }
63
- export interface DualOpenCodePlugin extends OpenCodeV2PluginDefinition {
64
- server: (options: any) => Promise<any>;
65
- }
66
- export declare function defineOpenCodeV2Plugin(def: OpenCodeV2PluginDefinition): OpenCodeV2PluginDefinition;
@@ -1,6 +1,4 @@
1
1
  import type { PluginContext, PluginResult } from './plugin/types';
2
- import { STATIC_MODELS_SIMPLE, TIER_MAPPING, resolveModelTier, type SimpleStaticModel } from './plugin/tier';
3
- export { STATIC_MODELS_SIMPLE, TIER_MAPPING, resolveModelTier, type SimpleStaticModel };
4
2
  /**
5
3
  * Registers the Agy OAuth provider for Opencode.
6
4
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anthonyhaussman/opencode-agy-auth",
3
- "version": "1.2.7-alpha.3",
3
+ "version": "1.2.7",
4
4
  "author": "antigravity",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,7 +0,0 @@
1
- /**
2
- * HTTP header and URL manipulation utilities.
3
- * Shared between OpenCode v1 and v2 runtimes.
4
- */
5
- export declare function getSafeHeader(headers: unknown, key: string): string | undefined;
6
- export declare function setSafeHeaders(initHeaders: unknown, newHeaders: Record<string, string>): unknown;
7
- export declare function toUrlString(value: RequestInfo): string;
@@ -1,28 +0,0 @@
1
- export interface SimpleStaticModel {
2
- name: string;
3
- description: string;
4
- maxTokens: number;
5
- maxOutputTokens: number;
6
- toolCall: boolean;
7
- reasoning: boolean;
8
- attachment: boolean;
9
- cost?: {
10
- input: number;
11
- output: number;
12
- cache?: {
13
- read: number;
14
- write: number;
15
- };
16
- };
17
- }
18
- export declare const STATIC_MODELS_SIMPLE: Record<string, SimpleStaticModel>;
19
- export declare const TIER_MAPPING: Record<string, {
20
- low: string;
21
- high: string;
22
- medium?: string;
23
- minimal?: string;
24
- } & Record<string, string | undefined>>;
25
- /**
26
- * Resolves a model ID and optional request headers or suffix into the appropriate tier variant.
27
- */
28
- export declare function resolveModelTier(baseModelId: string, headersOrInit?: RequestInit | unknown): string;
@@ -1 +0,0 @@
1
- export declare function createV2FetchInterceptor(getAuthSnapshot?: () => Promise<any> | any): (input: RequestInfo, init?: RequestInit) => Promise<Response>;
@@ -1,7 +0,0 @@
1
- export interface V2SessionHooksState {
2
- lastInterceptedModel?: string;
3
- }
4
- export declare function createV2HttpRequestHook(state?: V2SessionHooksState): (event: any) => Promise<void>;
5
- export declare function createV2HttpResponseHook(state?: V2SessionHooksState): (event: any) => Promise<void>;
6
- export declare function createV2RetryHook(): (event: any) => Promise<void>;
7
- export declare function registerV2SessionHooks(ctx: any): void;
@@ -1,3 +0,0 @@
1
- export declare function setStoredAuthOverrideForTesting(override: any): void;
2
- export declare function loadStoredAuthFromJson(): any;
3
- export declare function saveStoredAuthToJson(authRecord: any): void;
@@ -1,14 +0,0 @@
1
- import { AGY_V2_QUOTA_COMMAND, AGY_V2_QUOTA_COMMAND_TEMPLATE } from './quota';
2
- import { AGY_V2_QUOTA_SUMMARY_COMMAND, AGY_V2_QUOTA_SUMMARY_COMMAND_TEMPLATE } from './quota-summary';
3
- import { type OpenCodeV2PluginContext, type OpenCodeV2PluginDefinition } from './types';
4
- export { getSafeHeader, setSafeHeaders, toUrlString } from './headers';
5
- export { resolveModelTier } from './tier';
6
- export { loadStoredAuthFromJson, saveStoredAuthToJson, setStoredAuthOverrideForTesting, } from './v2-storage';
7
- export { createV2FetchInterceptor } from './v2-fetch';
8
- export { AGY_V2_QUOTA_COMMAND, AGY_V2_QUOTA_SUMMARY_COMMAND, AGY_V2_QUOTA_COMMAND_TEMPLATE, AGY_V2_QUOTA_SUMMARY_COMMAND_TEMPLATE, };
9
- /**
10
- * Setup adapter for OpenCode v2 plugin architecture.
11
- */
12
- export declare function setupOpenCodeV2(ctx: OpenCodeV2PluginContext): Promise<void>;
13
- export declare const v2PluginDefinition: OpenCodeV2PluginDefinition;
14
- export declare const createV2PluginDefinition: () => OpenCodeV2PluginDefinition;