import { AuthApiTransports } from "../../shared/transports.js"; import { PolyesterRequestOptions } from "../../shared/request-options.js"; import { SdkScales } from "../../shared/decimal-surface.js"; import { AssistantRunEvent } from "./assistant-events.schemas.js"; import { AssistantApprovalStatus } from "./assistant.codecs.js"; import { AssistantKey, AssistantRunIdInput, CompleteAssistantKeysInput, DecideAssistantApprovalInput, DeleteAssistantMemoryInput, ListAssistantConversationsInput, ListAssistantConversationsResult, ListAssistantMemoriesInput, ListAssistantMemoriesResult, ListAssistantMessagesInput, ListAssistantMessagesResult, PrepareAssistantKeysInput, PrepareAssistantKeysResult, SendAssistantMessageInput, WatchAssistantRunInput } from "./assistant.schemas.js"; //#region src/services/assistant/assistant.d.ts /** * The Polyester trading assistant. `sendMessage` starts a run that answers the message; * follow it with `watchRun`. A run continues on the server when nobody watches it. Actions that * change the account wait for `decideApproval`. Needs a session login; every conversation, run, * approval and memory belongs to the signed-in user. Errors carry * `detail: { service: "assistant", code }`. */ declare class AssistantService { #private; constructor(transports: AuthApiTransports, scales: SdkScales); /** * Records the message and starts a run that answers it; returns once the run is recorded. * Idempotent per `idempotencyKey`: repeat the request unchanged to resolve an unknown * outcome. A conversation runs one run at a time (`RUN_ACTIVE`). */ sendMessage(input: SendAssistantMessageInput, options?: PolyesterRequestOptions): Promise<{ runId: string; conversationId: string; }>; /** * Streams a run's events in `seq` order: the recorded events after `afterSeq`, then new ones * as they are recorded. Ends after `run_completed` or `run_failed`; watching an ended run * replays it. The server may end the stream early: call again with the last `seq` received * as `afterSeq` to continue without gaps or repeats. Abort with `options.signal`. */ watchRun(input: WatchAssistantRunInput, options?: PolyesterRequestOptions): AsyncGenerator; /** * Asks an active run to stop; it then ends with `run_failed` category `cancelled`. * Cancelling an ended run succeeds and changes nothing. */ cancelRun(input: AssistantRunIdInput, options?: PolyesterRequestOptions): Promise; /** * Approves or rejects a pending approval from an `approval_requested` event. An approved * action runs exactly as its summary says, at most once. Repeating the same decision returns * the recorded status. */ decideApproval(input: DecideAssistantApprovalInput, options?: PolyesterRequestOptions): Promise; /** Lists the caller's conversations, most recently updated first. */ listConversations(input?: ListAssistantConversationsInput, options?: PolyesterRequestOptions): Promise; /** Lists one conversation's messages, newest first. */ listMessages(input: ListAssistantMessagesInput, options?: PolyesterRequestOptions): Promise; /** * Lists what the assistant remembers about the caller, newest first. A `profile` memory * applies to every answer; the others are used when relevant. */ listMemories(input?: ListAssistantMemoriesInput, options?: PolyesterRequestOptions): Promise; /** Makes the assistant forget one memory. Deleting a deleted memory succeeds. */ deleteMemory(input: DeleteAssistantMemoryInput, options?: PolyesterRequestOptions): Promise; /** * Step 1 of giving the assistant keys: the assistant generates one Ed25519 key pair per * account and returns the public keys with their registration proofs. Register them with * `apiKeys.setAssistantKeys` (with a fresh `stepUpToken`) before `expiresAt`, then call * `completeKeys`. The step-up token goes to `setAssistantKeys` only, never to the assistant. */ prepareKeys(input: PrepareAssistantKeysInput, options?: PolyesterRequestOptions): Promise; /** * Finishes a key setup once `apiKeys.setAssistantKeys` registered its keys; returns the keys * the assistant now holds. Completing a completed setup returns the keys again. */ completeKeys(input: CompleteAssistantKeysInput, options?: PolyesterRequestOptions): Promise; /** * Lists the keys the assistant holds, at most one per account. An account without one has * no account tools. Revoke them with `apiKeys.deleteAssistantKeys`. */ listKeys(options?: PolyesterRequestOptions): Promise; } //#endregion export { AssistantService }; //# sourceMappingURL=assistant.d.ts.map