@ever-works/opencode-plugin 1.0.0 → 1.0.5

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,79 @@
1
+ import { IPlugin, IPipelinePlugin, IFormSchemaProvider, ICodeEditPlugin, PluginCategory, JsonSchema, PluginContext, PluginHealthCheck, ConnectionValidationResult, ValidationResult, PluginManifest, FormFieldDefinition, FormFieldGroup, PipelineStepDefinition, WorkReference, GenerationRequest, ExistingItems, PipelineExecutionOptions, PipelineProgressCallback, PipelineResult, PipelineState, CodeEditRequest, CodeEditOptions, CodeEditResult } from '@ever-works/plugin';
2
+
3
+ /**
4
+ * Step IDs for the OpenCode pipeline.
5
+ * All steps run sequentially (non-parallelizable).
6
+ */
7
+ type OpenCodeStepId = 'setup-opencode' | 'prepare-context' | 'generate-items' | 'collect-results' | 'capture-screenshots' | 'cleanup';
8
+ /**
9
+ * All step IDs as an array for iteration
10
+ */
11
+ declare const OPENCODE_STEP_IDS: readonly OpenCodeStepId[];
12
+ /**
13
+ * Type guard for OpenCodeStepId
14
+ */
15
+ declare function isOpenCodeStepId(value: string): value is OpenCodeStepId;
16
+
17
+ /**
18
+ * OpenCode Generator Plugin
19
+ *
20
+ * Full pipeline plugin that delegates the entire generation to OpenCode.
21
+ * Runs a single OpenCode session that handles web search,
22
+ * content creation, and file generation autonomously.
23
+ */
24
+ declare class OpenCodePlugin implements IPlugin, IPipelinePlugin, IFormSchemaProvider, ICodeEditPlugin {
25
+ readonly id = "opencode";
26
+ readonly name = "OpenCode Generator";
27
+ readonly providerName = "OpenCode";
28
+ readonly version = "1.0.0";
29
+ readonly category: PluginCategory;
30
+ readonly capabilities: readonly ["pipeline", "form-schema-provider", "code-edit"];
31
+ readonly configurationMode: "user-required";
32
+ readonly handledConfigFields: readonly ["*"];
33
+ readonly settingsSchema: JsonSchema;
34
+ private context;
35
+ private state;
36
+ private abortController;
37
+ private killProcess;
38
+ onLoad(context: PluginContext): Promise<void>;
39
+ onUnload(): Promise<void>;
40
+ healthCheck(): Promise<PluginHealthCheck>;
41
+ listModels(): Promise<readonly []>;
42
+ isAvailable(settings?: Record<string, unknown>): Promise<boolean>;
43
+ validateConnection(settings: Record<string, unknown>): Promise<ConnectionValidationResult>;
44
+ validateSettings(settings: Record<string, unknown>): ValidationResult;
45
+ getManifest(): PluginManifest;
46
+ getFormFields(): FormFieldDefinition[];
47
+ getFormGroups(): FormFieldGroup[];
48
+ validateFormInput(values: Record<string, unknown>): ValidationResult;
49
+ getDefaultValues(): Record<string, unknown>;
50
+ getStepDefinitions(): readonly PipelineStepDefinition[];
51
+ execute(work: WorkReference, request: GenerationRequest, existing: ExistingItems, options?: PipelineExecutionOptions, onProgress?: PipelineProgressCallback): Promise<PipelineResult>;
52
+ cancel(): Promise<void>;
53
+ getState(): PipelineState<OpenCodeStepId> | null;
54
+ private resolveAiProvider;
55
+ private runScreenshotCapture;
56
+ private createOpenCodeStreamHandlers;
57
+ private static readonly PROMPT_FENCE_TOKEN_PATTERN;
58
+ private neutralizePromptFences;
59
+ private buildCombinedPrompt;
60
+ private buildOpenCodeLogFromStdout;
61
+ private extractOpenCodeContentText;
62
+ private extractString;
63
+ private truncateLogMessage;
64
+ private startStep;
65
+ private completeStep;
66
+ private failStep;
67
+ private skipStep;
68
+ private emitOpenCodeLog;
69
+ private getStepName;
70
+ private getRunningStepId;
71
+ private extractErrorDetail;
72
+ private setState;
73
+ private handleError;
74
+ private handleCancel;
75
+ executeCodeEdit(request: CodeEditRequest, options?: CodeEditOptions): Promise<CodeEditResult>;
76
+ cancelCodeEdit(): Promise<void>;
77
+ }
78
+
79
+ export { OPENCODE_STEP_IDS, OpenCodePlugin, type OpenCodeStepId, OpenCodePlugin as default, isOpenCodeStepId };
@@ -0,0 +1,79 @@
1
+ import { IPlugin, IPipelinePlugin, IFormSchemaProvider, ICodeEditPlugin, PluginCategory, JsonSchema, PluginContext, PluginHealthCheck, ConnectionValidationResult, ValidationResult, PluginManifest, FormFieldDefinition, FormFieldGroup, PipelineStepDefinition, WorkReference, GenerationRequest, ExistingItems, PipelineExecutionOptions, PipelineProgressCallback, PipelineResult, PipelineState, CodeEditRequest, CodeEditOptions, CodeEditResult } from '@ever-works/plugin';
2
+
3
+ /**
4
+ * Step IDs for the OpenCode pipeline.
5
+ * All steps run sequentially (non-parallelizable).
6
+ */
7
+ type OpenCodeStepId = 'setup-opencode' | 'prepare-context' | 'generate-items' | 'collect-results' | 'capture-screenshots' | 'cleanup';
8
+ /**
9
+ * All step IDs as an array for iteration
10
+ */
11
+ declare const OPENCODE_STEP_IDS: readonly OpenCodeStepId[];
12
+ /**
13
+ * Type guard for OpenCodeStepId
14
+ */
15
+ declare function isOpenCodeStepId(value: string): value is OpenCodeStepId;
16
+
17
+ /**
18
+ * OpenCode Generator Plugin
19
+ *
20
+ * Full pipeline plugin that delegates the entire generation to OpenCode.
21
+ * Runs a single OpenCode session that handles web search,
22
+ * content creation, and file generation autonomously.
23
+ */
24
+ declare class OpenCodePlugin implements IPlugin, IPipelinePlugin, IFormSchemaProvider, ICodeEditPlugin {
25
+ readonly id = "opencode";
26
+ readonly name = "OpenCode Generator";
27
+ readonly providerName = "OpenCode";
28
+ readonly version = "1.0.0";
29
+ readonly category: PluginCategory;
30
+ readonly capabilities: readonly ["pipeline", "form-schema-provider", "code-edit"];
31
+ readonly configurationMode: "user-required";
32
+ readonly handledConfigFields: readonly ["*"];
33
+ readonly settingsSchema: JsonSchema;
34
+ private context;
35
+ private state;
36
+ private abortController;
37
+ private killProcess;
38
+ onLoad(context: PluginContext): Promise<void>;
39
+ onUnload(): Promise<void>;
40
+ healthCheck(): Promise<PluginHealthCheck>;
41
+ listModels(): Promise<readonly []>;
42
+ isAvailable(settings?: Record<string, unknown>): Promise<boolean>;
43
+ validateConnection(settings: Record<string, unknown>): Promise<ConnectionValidationResult>;
44
+ validateSettings(settings: Record<string, unknown>): ValidationResult;
45
+ getManifest(): PluginManifest;
46
+ getFormFields(): FormFieldDefinition[];
47
+ getFormGroups(): FormFieldGroup[];
48
+ validateFormInput(values: Record<string, unknown>): ValidationResult;
49
+ getDefaultValues(): Record<string, unknown>;
50
+ getStepDefinitions(): readonly PipelineStepDefinition[];
51
+ execute(work: WorkReference, request: GenerationRequest, existing: ExistingItems, options?: PipelineExecutionOptions, onProgress?: PipelineProgressCallback): Promise<PipelineResult>;
52
+ cancel(): Promise<void>;
53
+ getState(): PipelineState<OpenCodeStepId> | null;
54
+ private resolveAiProvider;
55
+ private runScreenshotCapture;
56
+ private createOpenCodeStreamHandlers;
57
+ private static readonly PROMPT_FENCE_TOKEN_PATTERN;
58
+ private neutralizePromptFences;
59
+ private buildCombinedPrompt;
60
+ private buildOpenCodeLogFromStdout;
61
+ private extractOpenCodeContentText;
62
+ private extractString;
63
+ private truncateLogMessage;
64
+ private startStep;
65
+ private completeStep;
66
+ private failStep;
67
+ private skipStep;
68
+ private emitOpenCodeLog;
69
+ private getStepName;
70
+ private getRunningStepId;
71
+ private extractErrorDetail;
72
+ private setState;
73
+ private handleError;
74
+ private handleCancel;
75
+ executeCodeEdit(request: CodeEditRequest, options?: CodeEditOptions): Promise<CodeEditResult>;
76
+ cancelCodeEdit(): Promise<void>;
77
+ }
78
+
79
+ export { OPENCODE_STEP_IDS, OpenCodePlugin, type OpenCodeStepId, OpenCodePlugin as default, isOpenCodeStepId };