export { AgentOpsError, type AgentOpsErrorOptions } from "./client-http.js";

export interface AgentClientOptions {
  /** Agent origin, e.g. http://localhost:43179 or the configured HTTPS address. */
  baseUrl: string;
  /** Agent bearer. Defaults to AZWOL_AGENT_TOKEN, then the same-user local HTTP connection file. */
  token?: string;
  fetch?: typeof globalThis.fetch;
  /** Network timeout in milliseconds. Default 150000. */
  timeoutMs?: number;
}

export interface AgentToolTask {
  runnerId: string;
  agentId: string;
  tool: string;
  input: import("../packages/local-core/index.cjs").JsonValue;
}

export type AgentReceipt = import("../packages/local-core/index.cjs").FinishedTask & {
  mode: "local";
  runnerId: string;
  agentId: string;
  teamId?: string;
  role?: string;
  provider?: string;
  model?: string;
  thinking?: string;
  policy: {
    profile: string;
    sha256: string;
    decision: "allow" | "deny";
    reason: string;
    memorySha256?: string;
  };
};

export class AgentClient {
  constructor(options: AgentClientOptions);
  readonly tasks: {
    /** Returns the terminal execution or denial receipt. Does not automatically retry. */
    create(task: AgentToolTask): Promise<AgentReceipt>;
    get(taskId: string): Promise<AgentReceipt>;
  };
}
