@anthonyhaussman/opencode-agy-auth 1.2.2-alpha.0 → 1.2.3-alpha.0
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 +1 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +173 -3
- package/dist/index.js.map +1 -1
- package/dist/src/plugin/types.d.ts +26 -0
- package/dist/src/plugin/v2.d.ts +14 -0
- package/dist/src/plugin.d.ts +23 -0
- package/package.json +1 -1
|
@@ -29,3 +29,29 @@ 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) => void;
|
|
37
|
+
}
|
|
38
|
+
export interface OpenCodeV2PluginLocation {
|
|
39
|
+
root?: string;
|
|
40
|
+
workspace?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface OpenCodeV2PluginContext {
|
|
43
|
+
catalog: OpenCodeV2TransformRegistry;
|
|
44
|
+
tool: OpenCodeV2TransformRegistry;
|
|
45
|
+
command: OpenCodeV2TransformRegistry;
|
|
46
|
+
session: OpenCodeV2SessionRegistry;
|
|
47
|
+
integration: OpenCodeV2TransformRegistry;
|
|
48
|
+
location: OpenCodeV2PluginLocation;
|
|
49
|
+
}
|
|
50
|
+
export interface OpenCodeV2PluginDefinition {
|
|
51
|
+
id: string;
|
|
52
|
+
setup: (ctx: OpenCodeV2PluginContext) => Promise<void> | void;
|
|
53
|
+
}
|
|
54
|
+
export interface DualOpenCodePlugin extends OpenCodeV2PluginDefinition {
|
|
55
|
+
server: (options: any) => Promise<any>;
|
|
56
|
+
}
|
|
57
|
+
export declare function defineOpenCodeV2Plugin(def: OpenCodeV2PluginDefinition): OpenCodeV2PluginDefinition;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type OpenCodeV2PluginContext, type OpenCodeV2PluginDefinition } from './types';
|
|
2
|
+
export declare const AGY_V2_QUOTA_COMMAND = "agy-quota";
|
|
3
|
+
export declare const AGY_V2_QUOTA_SUMMARY_COMMAND = "agy-quota-summary";
|
|
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
|
+
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";
|
|
6
|
+
/**
|
|
7
|
+
* Setup adapter for OpenCode v2 plugin architecture.
|
|
8
|
+
*/
|
|
9
|
+
export declare function setupOpenCodeV2(ctx: OpenCodeV2PluginContext): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* OpenCode v2 Plugin Definition
|
|
12
|
+
*/
|
|
13
|
+
export declare const v2PluginDefinition: OpenCodeV2PluginDefinition;
|
|
14
|
+
export declare const createV2PluginDefinition: () => OpenCodeV2PluginDefinition;
|
package/dist/src/plugin.d.ts
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
import type { PluginContext, PluginResult } from './plugin/types';
|
|
2
|
+
export interface SimpleStaticModel {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
maxTokens: number;
|
|
6
|
+
maxOutputTokens: number;
|
|
7
|
+
toolCall: boolean;
|
|
8
|
+
reasoning: boolean;
|
|
9
|
+
attachment: boolean;
|
|
10
|
+
cost?: {
|
|
11
|
+
input: number;
|
|
12
|
+
output: number;
|
|
13
|
+
cache?: {
|
|
14
|
+
read: number;
|
|
15
|
+
write: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare const STATIC_MODELS_SIMPLE: Record<string, SimpleStaticModel>;
|
|
20
|
+
export declare const TIER_MAPPING: Record<string, {
|
|
21
|
+
low: string;
|
|
22
|
+
high: string;
|
|
23
|
+
medium?: string;
|
|
24
|
+
} & Record<string, string | undefined>>;
|
|
2
25
|
/**
|
|
3
26
|
* Registers the Agy OAuth provider for Opencode.
|
|
4
27
|
*/
|