/**
 * This file was generated by @pikku/cli@0.12.23
 */
/**
 * This provides the structure needed for typescript to be aware of routes and their return types
 */

import type { StreamWorkflowRunInput } from '@pikku/addon-console/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen'
import type { WorkflowRunStatus } from '@pikku/core/dist/wirings/workflow/workflow.types'



export type AgentApproveCallerInput = { agentName: string; runId: string; approvals: { toolCallId: string; approved: boolean; }[]; }
export type AgentCallerInput = { agentName: string; message: string; threadId: string; resourceId: string; }
export type AgentResumeCallerInput = { agentName: string; runId: string; toolCallId: string; approved: boolean; }
export type AgentStreamCallerInput = { agentName: string; message: string; threadId: string; resourceId: string; }
export type DeleteAgentThreadInput = { threadId: string; resourceId?: string; }
export type DeleteAgentThreadOutput = { deleted: boolean; }
export type GetAgentThreadMessagesInput = { threadId: string; resourceId?: string; }
export type GetAgentThreadMessagesOutput = any[]
export type GetAgentThreadRunsInput = { threadId: string; resourceId?: string; }
export type GetAgentThreadRunsOutput = any[]
export type GetAgentThreadsInput = { agentName?: string; resourceId?: string; limit?: number; offset?: number; }
export type GetAgentThreadsOutput = any[]
export type GraphStarterInput = { workflowName: string; nodeId: string; data?: unknown; }
export type GraphStarterOutput = { runId: string; }
export type PikkuConsoleGetSecretInput = { secretId: string; }
export type PikkuConsoleGetSecretOutput = { exists: boolean; value: unknown; }
export type PikkuConsoleGetVariableInput = { variableId: string; }
export type PikkuConsoleGetVariableOutput = { exists: boolean; value: unknown; }
export type PikkuConsoleHasSecretInput = { secretId: string; }
export type PikkuConsoleHasSecretOutput = { exists: boolean; }
export type PikkuConsoleSetSecretInput = { secretId: string; value: unknown; }
export type PikkuConsoleSetSecretOutput = { success: boolean; }
export type PikkuConsoleSetVariableInput = { variableId: string; value: unknown; }
export type PikkuConsoleSetVariableOutput = { success: boolean; }
export type RemoteRPCHandlerInput = { rpcName: string; data?: unknown; }
export type RpcCallerInput = { rpcName: string; data?: unknown; }
export type WorkflowRunnerInput = { workflowName: string; data?: unknown; }
export type WorkflowStarterInput = { workflowName: string; data?: unknown; }
export type WorkflowStarterOutput = { runId: string; }
export type WorkflowStatusCheckerInput = { workflowName: string; runId: string; }
export type WorkflowStatusStreamFullInput = { workflowName: string; runId: string; }
export type WorkflowStatusStreamInput = { workflowName: string; runId: string; }

// The '& {}' is a workaround for not directly refering to a type since it confuses typescript
export type StreamWorkflowRunInputParams = Pick<StreamWorkflowRunInput, 'runId'> & {}
export type StreamWorkflowRunInputBody = Omit<StreamWorkflowRunInput, 'runId'> & {}
export type RemoteRPCHandlerInputParams = Pick<RemoteRPCHandlerInput, 'rpcName'> & {}
export type RemoteRPCHandlerInputBody = Omit<RemoteRPCHandlerInput, 'rpcName'> & {}
export type WorkflowStarterInputParams = Pick<WorkflowStarterInput, 'workflowName'> & {}
export type WorkflowStarterInputBody = Omit<WorkflowStarterInput, 'workflowName'> & {}
export type WorkflowRunnerInputParams = Pick<WorkflowRunnerInput, 'workflowName'> & {}
export type WorkflowRunnerInputBody = Omit<WorkflowRunnerInput, 'workflowName'> & {}
export type WorkflowStatusCheckerInputParams = Pick<WorkflowStatusCheckerInput, 'workflowName' | 'runId'> & {}
export type WorkflowStatusCheckerInputBody = Omit<WorkflowStatusCheckerInput, 'workflowName' | 'runId'> & {}
export type WorkflowStatusStreamInputParams = Pick<WorkflowStatusStreamInput, 'workflowName' | 'runId'> & {}
export type WorkflowStatusStreamInputBody = Omit<WorkflowStatusStreamInput, 'workflowName' | 'runId'> & {}
export type WorkflowStatusStreamFullInputParams = Pick<WorkflowStatusStreamFullInput, 'workflowName' | 'runId'> & {}
export type WorkflowStatusStreamFullInputBody = Omit<WorkflowStatusStreamFullInput, 'workflowName' | 'runId'> & {}
export type GraphStarterInputParams = Pick<GraphStarterInput, 'workflowName' | 'nodeId'> & {}
export type GraphStarterInputBody = Omit<GraphStarterInput, 'workflowName' | 'nodeId'> & {}
export type RpcCallerInputParams = Pick<RpcCallerInput, 'rpcName'> & {}
export type RpcCallerInputBody = Omit<RpcCallerInput, 'rpcName'> & {}
export type AgentCallerInputParams = Pick<AgentCallerInput, 'agentName'> & {}
export type AgentCallerInputBody = Omit<AgentCallerInput, 'agentName'> & {}
export type AgentStreamCallerInputParams = Pick<AgentStreamCallerInput, 'agentName'> & {}
export type AgentStreamCallerInputBody = Omit<AgentStreamCallerInput, 'agentName'> & {}
export type AgentApproveCallerInputParams = Pick<AgentApproveCallerInput, 'agentName'> & {}
export type AgentApproveCallerInputBody = Omit<AgentApproveCallerInput, 'agentName'> & {}
export type AgentResumeCallerInputParams = Pick<AgentResumeCallerInput, 'agentName'> & {}
export type AgentResumeCallerInputBody = Omit<AgentResumeCallerInput, 'agentName'> & {}

interface HTTPWiringHandler<I, O> {
    input: I;
    output: O;
}

export type HTTPWiringsMap = {
  readonly '/workflow-run/:runId/stream': {
    readonly GET: HTTPWiringHandler<StreamWorkflowRunInput, null>,
  },
  readonly '/workflow/:workflowName/status/:runId': {
    readonly GET: HTTPWiringHandler<WorkflowStatusCheckerInput, WorkflowRunStatus>,
  },
  readonly '/workflow/:workflowName/status/:runId/stream': {
    readonly GET: HTTPWiringHandler<WorkflowStatusStreamInput, null>,
  },
  readonly '/workflow/:workflowName/status/:runId/stream/full': {
    readonly GET: HTTPWiringHandler<WorkflowStatusStreamFullInput, null>,
  },
  readonly '/remote/rpc/:rpcName': {
    readonly POST: HTTPWiringHandler<RemoteRPCHandlerInput, null>,
  },
  readonly '/workflow/:workflowName/start': {
    readonly POST: HTTPWiringHandler<WorkflowStarterInput, WorkflowStarterOutput>,
  },
  readonly '/workflow/:workflowName/run': {
    readonly POST: HTTPWiringHandler<WorkflowRunnerInput, null>,
  },
  readonly '/workflow/:workflowName/graph/:nodeId': {
    readonly POST: HTTPWiringHandler<GraphStarterInput, GraphStarterOutput>,
  },
  readonly '/rpc/:rpcName': {
    readonly POST: HTTPWiringHandler<RpcCallerInput, null>,
  },
  readonly '/rpc/agent/:agentName': {
    readonly POST: HTTPWiringHandler<AgentCallerInput, null>,
  },
  readonly '/rpc/agent/:agentName/stream': {
    readonly POST: HTTPWiringHandler<AgentStreamCallerInput, null>,
  },
  readonly '/rpc/agent/:agentName/approve': {
    readonly POST: HTTPWiringHandler<AgentApproveCallerInput, null>,
  },
  readonly '/rpc/agent/:agentName/resume': {
    readonly POST: HTTPWiringHandler<AgentResumeCallerInput, null>,
  },
};

export type HTTPWiringHandlerOf<HTTPWiring extends keyof HTTPWiringsMap, Method extends keyof HTTPWiringsMap[HTTPWiring]> =
    HTTPWiringsMap[HTTPWiring][Method] extends { input: infer I; output: infer O }
        ? HTTPWiringHandler<I, O>
        : never;

export type HTTPWiringsWithMethod<Method extends string> = {
  [HTTPWiring in keyof HTTPWiringsMap]: Method extends keyof HTTPWiringsMap[HTTPWiring] ? HTTPWiring : never;
}[keyof HTTPWiringsMap];
  