import { Plugin } from '@opencode-ai/plugin';
export { Hooks, Plugin, PluginInput, PluginModule, ToolContext, ToolDefinition } from '@opencode-ai/plugin';

/**
 * OpenCode Plugin Types
 *
 * Re-exports the types we need directly from the official @opencode-ai/plugin
 * SDK so that any change to the SDK's type signatures (e.g. ToolContext.ask)
 * is caught at compile time rather than silently breaking at runtime.
 *
 * Only types that are NOT exported by the SDK are defined here.
 */

type SessionCompactedEvent = {
    type: 'session.compacted';
    properties: {
        sessionID: string;
    };
};
type SessionIdleEvent = {
    type: 'session.idle';
    properties: {
        sessionID: string;
    };
};
type OtherEvent = {
    type: string;
    properties: Record<string, unknown>;
};
type BusEvent = SessionCompactedEvent | SessionIdleEvent | OtherEvent;

/**
 * OpenCode Workflows Plugin
 *
 * Integrates workflows-core state management with OpenCode hooks to provide
 * phase-aware development guidance and file edit restrictions.
 *
 * Hooks implemented:
 * 1. chat.message - Add synthetic part with phase instructions after each user message
 * 2. tool.execute.before - Block editing of certain files based on phase
 * 3. experimental.session.compacting - Inject workflow state into compaction context
 *
 * Logs are sent via OpenCode SDK's client.app.log() API
 */

/**
 * Main plugin export
 */
declare const WorkflowsPlugin: Plugin;
declare const _default: {
    id: string;
    server: Plugin;
};

export { type BusEvent, type OtherEvent, type SessionCompactedEvent, type SessionIdleEvent, WorkflowsPlugin, _default as default };
