@cgasgarth/opencode-for-rust 1.0.3 → 1.0.4-next.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,3 @@
1
+ import { Plugin } from '@opencode-ai/plugin';
2
+ export declare const RustPlugin: Plugin;
3
+ export default RustPlugin;
@@ -0,0 +1,11 @@
1
+ import { ExtractedType, TypeInjectionConfig } from './types';
2
+ export declare class RustTypeExtractor {
3
+ private config;
4
+ private parser;
5
+ constructor(config: TypeInjectionConfig);
6
+ extract(filePath: string, content?: string): Promise<ExtractedType[]>;
7
+ private mapNodeToKind;
8
+ private isExported;
9
+ private getDocComment;
10
+ private getSignature;
11
+ }
@@ -0,0 +1,7 @@
1
+ import { ExtractedType, TypeInjectionConfig } from './types';
2
+ export declare class RustContentFormatter {
3
+ private config;
4
+ constructor(config: TypeInjectionConfig);
5
+ formatInjectedTypes(types: ExtractedType[]): string;
6
+ private sortTypes;
7
+ }
@@ -0,0 +1,15 @@
1
+ import { ExtractedType, TypeInjectionConfig } from './types';
2
+ export declare class RustTypeLookup {
3
+ private directory;
4
+ private config;
5
+ private extractor;
6
+ private cache;
7
+ private lastScanTime;
8
+ constructor(directory: string, config: TypeInjectionConfig);
9
+ findType(name: string): Promise<ExtractedType | undefined>;
10
+ listTypeNames(): Promise<string[]>;
11
+ refresh(): Promise<void>;
12
+ private getPriority;
13
+ private ensureCache;
14
+ private shouldExclude;
15
+ }
@@ -0,0 +1,22 @@
1
+ export type RustTypeKind = 'function' | 'struct' | 'enum' | 'trait' | 'type_alias' | 'impl' | 'const' | 'macro';
2
+ export interface RustType {
3
+ name: string;
4
+ kind: RustTypeKind;
5
+ signature: string;
6
+ docComment?: string;
7
+ exported: boolean;
8
+ filePath: string;
9
+ lineStart: number;
10
+ lineEnd: number;
11
+ body?: string;
12
+ }
13
+ export interface TypeInjectionConfig {
14
+ enabled: boolean;
15
+ debug: boolean;
16
+ budget: number;
17
+ excludePatterns: string[];
18
+ imports: boolean;
19
+ }
20
+ export interface ExtractedType extends RustType {
21
+ isUsed?: boolean;
22
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgasgarth/opencode-for-rust",
3
- "version": "1.0.3",
3
+ "version": "1.0.4-next.1",
4
4
  "description": "OpenCode plugin for Rust",
5
5
  "author": {
6
6
  "name": "Sisyphus",