@ever-works/codex-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,76 @@
1
+ import { IPlugin, IPipelinePlugin, IFormSchemaProvider, IDeviceAuthProvider, ICodeEditPlugin, PluginCategory, JsonSchema, PluginContext, PluginHealthCheck, PluginManifest, AiModel, PipelineStepDefinition, FormFieldDefinition, FormFieldGroup, ValidationResult, ConnectionValidationResult, DeviceAuthStatus, WorkReference, GenerationRequest, ExistingItems, PipelineExecutionOptions, PipelineProgressCallback, PipelineResult, PipelineState, CodeEditRequest, CodeEditOptions, CodeEditResult } from '@ever-works/plugin';
2
+
3
+ type CodexStepId = 'setup-codex' | 'prepare-context' | 'generate-items' | 'collect-results' | 'capture-screenshots' | 'cleanup';
4
+ declare const CODEX_STEP_IDS: readonly CodexStepId[];
5
+ declare function isCodexStepId(value: string): value is CodexStepId;
6
+
7
+ declare class CodexPlugin implements IPlugin, IPipelinePlugin, IFormSchemaProvider, IDeviceAuthProvider, ICodeEditPlugin {
8
+ readonly id = "codex";
9
+ readonly name = "Codex Generator";
10
+ readonly providerName = "OpenAI Codex";
11
+ readonly version = "1.0.0";
12
+ readonly category: PluginCategory;
13
+ readonly capabilities: readonly ["pipeline", "form-schema-provider", "device-auth", "code-edit"];
14
+ readonly configurationMode: "user-required";
15
+ readonly handledConfigFields: readonly ["*"];
16
+ readonly settingsSchema: JsonSchema;
17
+ private context;
18
+ private state;
19
+ private abortController;
20
+ private killProcess;
21
+ private codexCommandPath;
22
+ onLoad(context: PluginContext): Promise<void>;
23
+ onUnload(): Promise<void>;
24
+ healthCheck(): Promise<PluginHealthCheck>;
25
+ getManifest(): PluginManifest;
26
+ listModels(): Promise<readonly AiModel[]>;
27
+ private getRealSecret;
28
+ private persistDeviceAuthPayload;
29
+ private getPersistedDeviceAuthStatus;
30
+ isAvailable(settings?: Record<string, unknown>): Promise<boolean>;
31
+ getStepDefinitions(): readonly PipelineStepDefinition<CodexStepId>[];
32
+ getFormFields(): FormFieldDefinition[];
33
+ getFormGroups(): FormFieldGroup[];
34
+ validateFormInput(values: Record<string, unknown>): ValidationResult;
35
+ getDefaultValues(): Record<string, unknown>;
36
+ validateSettings(settings: Record<string, unknown>): ValidationResult;
37
+ validateConnection(settings: Record<string, unknown>): Promise<ConnectionValidationResult>;
38
+ getDeviceAuthStatus(userId: string): Promise<DeviceAuthStatus>;
39
+ startDeviceAuth(userId: string): Promise<DeviceAuthStatus>;
40
+ execute(work: WorkReference, request: GenerationRequest, existing: ExistingItems, options?: PipelineExecutionOptions, onProgress?: PipelineProgressCallback): Promise<PipelineResult>;
41
+ cancel(): Promise<void>;
42
+ getState(): PipelineState<CodexStepId> | null;
43
+ private buildExecutionPrompt;
44
+ private runCodexPrompt;
45
+ private recoverItemsFromStructuredOutput;
46
+ private buildStructuredRecoveryPrompt;
47
+ private detectSandboxWriteBlock;
48
+ private normalizeRecoveredItem;
49
+ private hasRequiredRecoveredFields;
50
+ private startStep;
51
+ private completeStep;
52
+ private failStep;
53
+ private skipStep;
54
+ private emitCodexLog;
55
+ private getStepName;
56
+ private getRunningStepId;
57
+ private setState;
58
+ private truncateLogMessage;
59
+ private extractErrorDetail;
60
+ private validateApiKey;
61
+ private validateCliAuth;
62
+ private handleError;
63
+ private handleCancel;
64
+ private runScreenshotCapture;
65
+ executeCodeEdit(request: CodeEditRequest, options?: CodeEditOptions): Promise<CodeEditResult>;
66
+ cancelCodeEdit(): Promise<void>;
67
+ }
68
+
69
+ interface Logger {
70
+ log(message: string, ...args: unknown[]): void;
71
+ debug(message: string, ...args: unknown[]): void;
72
+ warn?(message: string, ...args: unknown[]): void;
73
+ }
74
+ declare function ensureBinary(version?: string, logger?: Logger): Promise<string>;
75
+
76
+ export { CODEX_STEP_IDS, CodexPlugin, type CodexStepId, CodexPlugin as default, ensureBinary, isCodexStepId };
@@ -0,0 +1,76 @@
1
+ import { IPlugin, IPipelinePlugin, IFormSchemaProvider, IDeviceAuthProvider, ICodeEditPlugin, PluginCategory, JsonSchema, PluginContext, PluginHealthCheck, PluginManifest, AiModel, PipelineStepDefinition, FormFieldDefinition, FormFieldGroup, ValidationResult, ConnectionValidationResult, DeviceAuthStatus, WorkReference, GenerationRequest, ExistingItems, PipelineExecutionOptions, PipelineProgressCallback, PipelineResult, PipelineState, CodeEditRequest, CodeEditOptions, CodeEditResult } from '@ever-works/plugin';
2
+
3
+ type CodexStepId = 'setup-codex' | 'prepare-context' | 'generate-items' | 'collect-results' | 'capture-screenshots' | 'cleanup';
4
+ declare const CODEX_STEP_IDS: readonly CodexStepId[];
5
+ declare function isCodexStepId(value: string): value is CodexStepId;
6
+
7
+ declare class CodexPlugin implements IPlugin, IPipelinePlugin, IFormSchemaProvider, IDeviceAuthProvider, ICodeEditPlugin {
8
+ readonly id = "codex";
9
+ readonly name = "Codex Generator";
10
+ readonly providerName = "OpenAI Codex";
11
+ readonly version = "1.0.0";
12
+ readonly category: PluginCategory;
13
+ readonly capabilities: readonly ["pipeline", "form-schema-provider", "device-auth", "code-edit"];
14
+ readonly configurationMode: "user-required";
15
+ readonly handledConfigFields: readonly ["*"];
16
+ readonly settingsSchema: JsonSchema;
17
+ private context;
18
+ private state;
19
+ private abortController;
20
+ private killProcess;
21
+ private codexCommandPath;
22
+ onLoad(context: PluginContext): Promise<void>;
23
+ onUnload(): Promise<void>;
24
+ healthCheck(): Promise<PluginHealthCheck>;
25
+ getManifest(): PluginManifest;
26
+ listModels(): Promise<readonly AiModel[]>;
27
+ private getRealSecret;
28
+ private persistDeviceAuthPayload;
29
+ private getPersistedDeviceAuthStatus;
30
+ isAvailable(settings?: Record<string, unknown>): Promise<boolean>;
31
+ getStepDefinitions(): readonly PipelineStepDefinition<CodexStepId>[];
32
+ getFormFields(): FormFieldDefinition[];
33
+ getFormGroups(): FormFieldGroup[];
34
+ validateFormInput(values: Record<string, unknown>): ValidationResult;
35
+ getDefaultValues(): Record<string, unknown>;
36
+ validateSettings(settings: Record<string, unknown>): ValidationResult;
37
+ validateConnection(settings: Record<string, unknown>): Promise<ConnectionValidationResult>;
38
+ getDeviceAuthStatus(userId: string): Promise<DeviceAuthStatus>;
39
+ startDeviceAuth(userId: string): Promise<DeviceAuthStatus>;
40
+ execute(work: WorkReference, request: GenerationRequest, existing: ExistingItems, options?: PipelineExecutionOptions, onProgress?: PipelineProgressCallback): Promise<PipelineResult>;
41
+ cancel(): Promise<void>;
42
+ getState(): PipelineState<CodexStepId> | null;
43
+ private buildExecutionPrompt;
44
+ private runCodexPrompt;
45
+ private recoverItemsFromStructuredOutput;
46
+ private buildStructuredRecoveryPrompt;
47
+ private detectSandboxWriteBlock;
48
+ private normalizeRecoveredItem;
49
+ private hasRequiredRecoveredFields;
50
+ private startStep;
51
+ private completeStep;
52
+ private failStep;
53
+ private skipStep;
54
+ private emitCodexLog;
55
+ private getStepName;
56
+ private getRunningStepId;
57
+ private setState;
58
+ private truncateLogMessage;
59
+ private extractErrorDetail;
60
+ private validateApiKey;
61
+ private validateCliAuth;
62
+ private handleError;
63
+ private handleCancel;
64
+ private runScreenshotCapture;
65
+ executeCodeEdit(request: CodeEditRequest, options?: CodeEditOptions): Promise<CodeEditResult>;
66
+ cancelCodeEdit(): Promise<void>;
67
+ }
68
+
69
+ interface Logger {
70
+ log(message: string, ...args: unknown[]): void;
71
+ debug(message: string, ...args: unknown[]): void;
72
+ warn?(message: string, ...args: unknown[]): void;
73
+ }
74
+ declare function ensureBinary(version?: string, logger?: Logger): Promise<string>;
75
+
76
+ export { CODEX_STEP_IDS, CodexPlugin, type CodexStepId, CodexPlugin as default, ensureBinary, isCodexStepId };