@smoothcodes/agent-client 0.1.3 → 0.2.0
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.
- package/CHANGELOG.md +31 -0
- package/dist/{chunk-X24QQ3X4.js → chunk-E4ZFXITU.js} +861 -211
- package/dist/chunk-E4ZFXITU.js.map +7 -0
- package/dist/index.js +1 -1
- package/dist/testing.js +1 -1
- package/dist/types/sdk/generated/ts-client/api/errors/BadRequestError.d.ts +3 -1
- package/dist/types/sdk/generated/ts-client/api/errors/ConflictError.d.ts +3 -1
- package/dist/types/sdk/generated/ts-client/api/errors/ForbiddenError.d.ts +3 -1
- package/dist/types/sdk/generated/ts-client/api/errors/InternalServerError.d.ts +3 -1
- package/dist/types/sdk/generated/ts-client/api/errors/TooManyRequestsError.d.ts +3 -1
- package/dist/types/sdk/generated/ts-client/api/errors/UnauthorizedError.d.ts +3 -1
- package/dist/types/sdk/generated/ts-client/api/resources/chats/client/Client.d.ts +3 -2
- package/dist/types/sdk/generated/ts-client/api/resources/chats/client/requests/CreateChat.d.ts +6 -0
- package/dist/types/sdk/generated/ts-client/api/resources/chats/client/requests/SwitchAgent.d.ts +21 -3
- package/dist/types/sdk/generated/ts-client/api/resources/providers/types/MyProvidersListResponse.d.ts +1 -1
- package/dist/types/sdk/generated/ts-client/api/types/Agent.d.ts +16 -5
- package/dist/types/sdk/generated/ts-client/api/types/AgentProviderOption.d.ts +11 -0
- package/dist/types/sdk/generated/ts-client/api/types/AgentPublic.d.ts +6 -1
- package/dist/types/sdk/generated/ts-client/api/types/ChatDeleted.d.ts +15 -0
- package/dist/types/sdk/generated/ts-client/api/types/ChatSelection.d.ts +2 -0
- package/dist/types/sdk/generated/ts-client/api/types/EventsFailure.d.ts +2 -2
- package/dist/types/sdk/generated/ts-client/api/types/EventsInboxState.d.ts +1 -0
- package/dist/types/sdk/generated/ts-client/api/types/ModelInfo.d.ts +6 -0
- package/dist/types/sdk/generated/ts-client/api/types/MyProviderStatus.d.ts +61 -0
- package/dist/types/sdk/generated/ts-client/api/types/index.d.ts +3 -0
- package/dist/types/sdk/generated/ts-client/environments.d.ts +1 -1
- package/dist/types/sdk/ts/client/src/index.d.ts +2 -1
- package/dist/types/sdk/ts/core-live/src/client.d.ts +1 -1
- package/package.json +3 -2
- package/dist/chunk-X24QQ3X4.js.map +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../generated/ts-client/core/json.ts", "../../../generated/ts-client/errors/SmoothAgentApiError.ts", "../../../generated/ts-client/errors/SmoothAgentApiTimeoutError.ts", "../../../generated/ts-client/api/errors/BadGatewayError.ts", "../../../generated/ts-client/api/errors/BadRequestError.ts", "../../../generated/ts-client/api/errors/ConflictError.ts", "../../../generated/ts-client/api/errors/FailedDependencyError.ts", "../../../generated/ts-client/api/errors/ForbiddenError.ts", "../../../generated/ts-client/api/errors/GoneError.ts", "../../../generated/ts-client/api/errors/InternalServerError.ts", "../../../generated/ts-client/api/errors/NotFoundError.ts", "../../../generated/ts-client/api/errors/PaymentRequiredError.ts", "../../../generated/ts-client/api/errors/ServiceUnavailableError.ts", "../../../generated/ts-client/api/errors/TooManyRequestsError.ts", "../../../generated/ts-client/api/errors/UnauthorizedError.ts", "../../../generated/ts-client/api/errors/UnprocessableEntityError.ts", "../../../generated/ts-client/api/resources/chats/client/requests/SendMessage.ts", "../../../generated/ts-client/api/resources/chats/types/ChatsSendResponse.ts", "../../../generated/ts-client/api/types/Agent.ts", "../../../generated/ts-client/api/types/BoxFileContent.ts", "../../../generated/ts-client/api/types/BoxFileEntry.ts", "../../../generated/ts-client/api/types/Chat.ts", "../../../generated/ts-client/api/types/ChatDeleted.ts", "../../../generated/ts-client/api/types/ChatSelection.ts", "../../../generated/ts-client/api/types/ChatTask.ts", "../../../generated/ts-client/api/types/EventsApprovalOption.ts", "../../../generated/ts-client/api/types/EventsCapabilities.ts", "../../../generated/ts-client/api/types/EventsDelta.ts", "../../../generated/ts-client/api/types/EventsEChatStateData.ts", "../../../generated/ts-client/api/types/EventsEItemRetractedData.ts", "../../../generated/ts-client/api/types/EventsENoticeData.ts", "../../../generated/ts-client/api/types/EventsERunCompletedData.ts", "../../../generated/ts-client/api/types/EventsERunStartedData.ts", "../../../generated/ts-client/api/types/EventsERunWaitingData.ts", "../../../generated/ts-client/api/types/EventsESessionStartedData.ts", "../../../generated/ts-client/api/types/EventsHandoffInjected.ts", "../../../generated/ts-client/api/types/EventsHandoffLost.ts", "../../../generated/ts-client/api/types/EventsInboxEntry.ts", "../../../generated/ts-client/api/types/EventsInboxState.ts", "../../../generated/ts-client/api/types/EventsItemApproval.ts", "../../../generated/ts-client/api/types/EventsItemCommand.ts", "../../../generated/ts-client/api/types/EventsItemCompaction.ts", "../../../generated/ts-client/api/types/EventsItemError.ts", "../../../generated/ts-client/api/types/EventsItemFileChange.ts", "../../../generated/ts-client/api/types/EventsItemFileSearch.ts", "../../../generated/ts-client/api/types/EventsItemHandoff.ts", "../../../generated/ts-client/api/types/EventsItemHook.ts", "../../../generated/ts-client/api/types/EventsItemNotification.ts", "../../../generated/ts-client/api/types/EventsItemPlan.ts", "../../../generated/ts-client/api/types/EventsItemProposedPlan.ts", "../../../generated/ts-client/api/types/EventsItemQuestion.ts", "../../../generated/ts-client/api/types/EventsItemReasoning.ts", "../../../generated/ts-client/api/types/EventsItemSubagent.ts", "../../../generated/ts-client/api/types/EventsItemText.ts", "../../../generated/ts-client/api/types/EventsItemTimer.ts", "../../../generated/ts-client/api/types/EventsItemToolCall.ts", "../../../generated/ts-client/api/types/EventsItemUserMessage.ts", "../../../generated/ts-client/api/types/EventsItemWebSearch.ts", "../../../generated/ts-client/api/types/EventsLimits.ts", "../../../generated/ts-client/api/types/EventsLimitWindow.ts", "../../../generated/ts-client/api/types/EventsOrigin.ts", "../../../generated/ts-client/api/types/EventsRawFrame.ts", "../../../generated/ts-client/api/types/EventsRunAgent.ts", "../../../generated/ts-client/api/types/EventsRunTrigger.ts", "../../../generated/ts-client/api/types/EventsTask.ts", "../../../generated/ts-client/api/types/FileObject.ts", "../../../generated/ts-client/api/types/LoginStatus.ts", "../../../generated/ts-client/api/types/Machine.ts", "../../../generated/ts-client/api/types/MyProviderStatus.ts", "../../../generated/ts-client/api/types/Pairing.ts", "../../../generated/ts-client/api/types/Placement.ts", "../../../generated/ts-client/api/types/PreTurnHook.ts", "../../../generated/ts-client/api/types/Principal.ts", "../../../generated/ts-client/api/types/ProviderLimits.ts", "../../../generated/ts-client/api/types/ProviderStatus.ts", "../../../generated/ts-client/api/types/RunSummary.ts", "../../../generated/ts-client/api/types/SwitchResult.ts", "../../../generated/ts-client/api/types/ToolPrincipal.ts", "../../../generated/ts-client/core/auth/AuthProvider.ts", "../../../generated/ts-client/core/auth/NoOpAuthProvider.ts", "../../../generated/ts-client/core/fetcher/EndpointSupplier.ts", "../../../generated/ts-client/core/logging/logger.ts", "../../../generated/ts-client/core/url/qs.ts", "../../../generated/ts-client/core/fetcher/createRequestUrl.ts", "../../../generated/ts-client/core/fetcher/BinaryResponse.ts", "../../../generated/ts-client/core/fetcher/getResponseBody.ts", "../../../generated/ts-client/core/fetcher/getErrorResponseBody.ts", "../../../generated/ts-client/core/fetcher/getFetchFn.ts", "../../../generated/ts-client/core/fetcher/getRequestBody.ts", "../../../generated/ts-client/core/fetcher/Headers.ts", "../../../generated/ts-client/core/fetcher/signals.ts", "../../../generated/ts-client/core/fetcher/makeRequest.ts", "../../../generated/ts-client/core/fetcher/RawResponse.ts", "../../../generated/ts-client/core/fetcher/redactUrl.ts", "../../../generated/ts-client/core/fetcher/requestWithRetries.ts", "../../../generated/ts-client/core/fetcher/Fetcher.ts", "../../../generated/ts-client/core/fetcher/HttpResponsePromise.ts", "../../../generated/ts-client/core/url/join.ts", "../../../generated/ts-client/core/fetcher/Supplier.ts", "../../../generated/ts-client/core/fetcher/makePassthroughRequest.ts", "../../../generated/ts-client/core/file/file.ts", "../../../generated/ts-client/core/runtime/runtime.ts", "../../../generated/ts-client/core/form-data-utils/FormDataWrapper.ts", "../../../generated/ts-client/core/logging/index.ts", "../../../generated/ts-client/core/pagination/Page.ts", "../../../generated/ts-client/core/stream/Stream.ts", "../../../generated/ts-client/core/url/index.ts", "../../../generated/ts-client/core/url/encodePathParam.ts", "../../../generated/ts-client/core/url/QueryStringBuilder.ts", "../../../generated/ts-client/core/utils/setObjectProperty.ts", "../../../generated/ts-client/auth/BearerAuthProvider.ts", "../../../generated/ts-client/core/headers.ts", "../../../generated/ts-client/BaseClient.ts", "../../../generated/ts-client/environments.ts", "../../../generated/ts-client/errors/handleNonStatusCodeError.ts", "../../../generated/ts-client/api/resources/agents/client/Client.ts", "../../../generated/ts-client/core/requestBody.ts", "../../../generated/ts-client/api/resources/chats/client/Client.ts", "../../../generated/ts-client/api/resources/files/client/Client.ts", "../../../generated/ts-client/api/resources/identity/client/Client.ts", "../../../generated/ts-client/api/resources/machines/client/Client.ts", "../../../generated/ts-client/api/resources/providers/client/Client.ts", "../../../generated/ts-client/Client.ts", "../../../generated/ts-client/core/logging/exports.ts", "../../core-live/src/auth.ts", "../../core-live/src/deps.ts", "../../core-live/src/wasm/live.js", "../../core-live/src/native.ts", "../../core-live/src/edge.ts", "../../core-live/src/ids.ts", "../../core-live/src/wasm/empty.ts", "../../../../contract/events/ts/src/gen/known.ts", "../../core-live/src/backoff.ts", "../../core-live/src/stream.ts", "../../core-live/src/types.ts", "../../core-live/src/watch.ts", "../../core-live/src/prompt.ts", "../../core-live/src/feed.ts", "../../core-live/src/client.ts", "../../core-live/src/rest.ts", "../../core-live/src/providers.ts", "../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Serialize a value to JSON\n * @param value A JavaScript value, usually an object or array, to be converted.\n * @param replacer A function that transforms the results.\n * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\n * @returns JSON string\n */\nexport const toJson = (\n value: unknown,\n replacer?: (this: unknown, key: string, value: unknown) => unknown,\n space?: string | number,\n): string => {\n return JSON.stringify(value, replacer, space);\n};\n\n/**\n * Parse JSON string to object, array, or other type\n * @param text A valid JSON string.\n * @param reviver A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is.\n * @returns Parsed object, array, or other type\n */\nexport function fromJson<T = unknown>(\n text: string,\n reviver?: (this: unknown, key: string, value: unknown) => unknown,\n): T {\n return JSON.parse(text, reviver);\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as core from \"../core/index.js\";\nimport { toJson } from \"../core/json.js\";\n\nexport class SmoothAgentApiError extends Error {\n public readonly statusCode?: number;\n public readonly body?: unknown;\n public readonly rawResponse?: core.RawResponse;\n public readonly cause?: unknown;\n\n constructor({\n message,\n statusCode,\n body,\n rawResponse,\n cause,\n }: {\n message?: string;\n statusCode?: number;\n body?: unknown;\n rawResponse?: core.RawResponse;\n cause?: unknown;\n }) {\n super(buildMessage({ message, statusCode, body }));\n Object.setPrototypeOf(this, new.target.prototype);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"SmoothAgentApiError\";\n this.statusCode = statusCode;\n this.body = body;\n this.rawResponse = rawResponse;\n if (cause != null) {\n this.cause = cause;\n }\n }\n\n public get requestId(): string | undefined {\n const headers = this.rawResponse?.headers;\n if (headers == null) {\n return undefined;\n }\n const requestId = headers.get(\"X-Request-Id\");\n if (requestId != null) {\n return requestId;\n }\n let fallback: string | undefined;\n headers.forEach((value, name) => {\n if (fallback === undefined && /request[-_]?id$/i.test(name)) {\n fallback = value;\n }\n });\n return fallback;\n }\n}\n\nfunction buildMessage({\n message,\n statusCode,\n body,\n}: {\n message: string | undefined;\n statusCode: number | undefined;\n body: unknown | undefined;\n}): string {\n const lines: string[] = [];\n if (message != null) {\n lines.push(message);\n }\n\n if (statusCode != null) {\n lines.push(`Status code: ${statusCode.toString()}`);\n }\n\n if (body != null) {\n lines.push(`Body: ${toJson(body, undefined, 2)}`);\n }\n\n return lines.join(\"\\n\");\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport * as errors from \"./index.js\";\n\nexport class SmoothAgentApiTimeoutError extends errors.SmoothAgentApiError {\n constructor(message: string, opts?: { cause?: unknown }) {\n super({\n message: message,\n cause: opts?.cause,\n });\n Object.setPrototypeOf(this, new.target.prototype);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"SmoothAgentApiTimeoutError\";\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as core from \"../../core/index.js\";\nimport * as errors from \"../../errors/index.js\";\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport class BadGatewayError extends errors.SmoothAgentApiError {\n public declare readonly body: SmoothAgentApi.Error_;\n\n constructor(body: SmoothAgentApi.Error_, rawResponse?: core.RawResponse) {\n super({\n message: \"BadGatewayError\",\n statusCode: 502,\n body: body,\n rawResponse: rawResponse,\n });\n Object.setPrototypeOf(this, new.target.prototype);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"BadGatewayError\";\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as core from \"../../core/index.js\";\nimport * as errors from \"../../errors/index.js\";\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport class BadRequestError extends errors.SmoothAgentApiError {\n public declare readonly body: SmoothAgentApi.Error_;\n\n constructor(body: SmoothAgentApi.Error_, rawResponse?: core.RawResponse) {\n super({\n message: \"BadRequestError\",\n statusCode: 400,\n body: body,\n rawResponse: rawResponse,\n });\n Object.setPrototypeOf(this, new.target.prototype);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"BadRequestError\";\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as core from \"../../core/index.js\";\nimport * as errors from \"../../errors/index.js\";\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport class ConflictError extends errors.SmoothAgentApiError {\n public declare readonly body: SmoothAgentApi.Error_;\n\n constructor(body: SmoothAgentApi.Error_, rawResponse?: core.RawResponse) {\n super({\n message: \"ConflictError\",\n statusCode: 409,\n body: body,\n rawResponse: rawResponse,\n });\n Object.setPrototypeOf(this, new.target.prototype);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"ConflictError\";\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as core from \"../../core/index.js\";\nimport * as errors from \"../../errors/index.js\";\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport class FailedDependencyError extends errors.SmoothAgentApiError {\n public declare readonly body: SmoothAgentApi.Error_;\n\n constructor(body: SmoothAgentApi.Error_, rawResponse?: core.RawResponse) {\n super({\n message: \"FailedDependencyError\",\n statusCode: 424,\n body: body,\n rawResponse: rawResponse,\n });\n Object.setPrototypeOf(this, new.target.prototype);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"FailedDependencyError\";\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as core from \"../../core/index.js\";\nimport * as errors from \"../../errors/index.js\";\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport class ForbiddenError extends errors.SmoothAgentApiError {\n public declare readonly body: SmoothAgentApi.Error_;\n\n constructor(body: SmoothAgentApi.Error_, rawResponse?: core.RawResponse) {\n super({\n message: \"ForbiddenError\",\n statusCode: 403,\n body: body,\n rawResponse: rawResponse,\n });\n Object.setPrototypeOf(this, new.target.prototype);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"ForbiddenError\";\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as core from \"../../core/index.js\";\nimport * as errors from \"../../errors/index.js\";\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport class GoneError extends errors.SmoothAgentApiError {\n public declare readonly body: SmoothAgentApi.Error_;\n\n constructor(body: SmoothAgentApi.Error_, rawResponse?: core.RawResponse) {\n super({\n message: \"GoneError\",\n statusCode: 410,\n body: body,\n rawResponse: rawResponse,\n });\n Object.setPrototypeOf(this, new.target.prototype);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"GoneError\";\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as core from \"../../core/index.js\";\nimport * as errors from \"../../errors/index.js\";\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport class InternalServerError extends errors.SmoothAgentApiError {\n public declare readonly body: SmoothAgentApi.Error_;\n\n constructor(body: SmoothAgentApi.Error_, rawResponse?: core.RawResponse) {\n super({\n message: \"InternalServerError\",\n statusCode: 500,\n body: body,\n rawResponse: rawResponse,\n });\n Object.setPrototypeOf(this, new.target.prototype);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"InternalServerError\";\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as core from \"../../core/index.js\";\nimport * as errors from \"../../errors/index.js\";\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport class NotFoundError extends errors.SmoothAgentApiError {\n public declare readonly body: SmoothAgentApi.Error_;\n\n constructor(body: SmoothAgentApi.Error_, rawResponse?: core.RawResponse) {\n super({\n message: \"NotFoundError\",\n statusCode: 404,\n body: body,\n rawResponse: rawResponse,\n });\n Object.setPrototypeOf(this, new.target.prototype);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"NotFoundError\";\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as core from \"../../core/index.js\";\nimport * as errors from \"../../errors/index.js\";\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport class PaymentRequiredError extends errors.SmoothAgentApiError {\n public declare readonly body: SmoothAgentApi.Error_;\n\n constructor(body: SmoothAgentApi.Error_, rawResponse?: core.RawResponse) {\n super({\n message: \"PaymentRequiredError\",\n statusCode: 402,\n body: body,\n rawResponse: rawResponse,\n });\n Object.setPrototypeOf(this, new.target.prototype);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"PaymentRequiredError\";\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as core from \"../../core/index.js\";\nimport * as errors from \"../../errors/index.js\";\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport class ServiceUnavailableError extends errors.SmoothAgentApiError {\n public declare readonly body: SmoothAgentApi.Error_;\n\n constructor(body: SmoothAgentApi.Error_, rawResponse?: core.RawResponse) {\n super({\n message: \"ServiceUnavailableError\",\n statusCode: 503,\n body: body,\n rawResponse: rawResponse,\n });\n Object.setPrototypeOf(this, new.target.prototype);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"ServiceUnavailableError\";\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as core from \"../../core/index.js\";\nimport * as errors from \"../../errors/index.js\";\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport class TooManyRequestsError extends errors.SmoothAgentApiError {\n public declare readonly body: SmoothAgentApi.Error_;\n\n constructor(body: SmoothAgentApi.Error_, rawResponse?: core.RawResponse) {\n super({\n message: \"TooManyRequestsError\",\n statusCode: 429,\n body: body,\n rawResponse: rawResponse,\n });\n Object.setPrototypeOf(this, new.target.prototype);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"TooManyRequestsError\";\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as core from \"../../core/index.js\";\nimport * as errors from \"../../errors/index.js\";\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport class UnauthorizedError extends errors.SmoothAgentApiError {\n public declare readonly body: SmoothAgentApi.Error_;\n\n constructor(body: SmoothAgentApi.Error_, rawResponse?: core.RawResponse) {\n super({\n message: \"UnauthorizedError\",\n statusCode: 401,\n body: body,\n rawResponse: rawResponse,\n });\n Object.setPrototypeOf(this, new.target.prototype);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"UnauthorizedError\";\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as core from \"../../core/index.js\";\nimport * as errors from \"../../errors/index.js\";\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport class UnprocessableEntityError extends errors.SmoothAgentApiError {\n public declare readonly body: SmoothAgentApi.Error_;\n\n constructor(body: SmoothAgentApi.Error_, rawResponse?: core.RawResponse) {\n super({\n message: \"UnprocessableEntityError\",\n statusCode: 422,\n body: body,\n rawResponse: rawResponse,\n });\n Object.setPrototypeOf(this, new.target.prototype);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"UnprocessableEntityError\";\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../../../../index.js\";\n\n/**\n * @example\n * {\n * id: \"id\",\n * content: \"content\"\n * }\n */\nexport interface SendMessage {\n id: string;\n \"SmoothAgent-As-User\"?: string;\n \"Idempotency-Key\"?: string;\n /** Texto ou partes (`ContentPart[]`, do contract/events). */\n content: SendMessage.Content;\n attachments?: string[];\n mode?: SendMessage.Mode;\n /**\n * Id da mensagem gerado pelo cliente (a SDK gera) pra exatamente-uma-vez; vira o\n * `messageId`. Sempre com prefixo `msg_` \u2014 \u00E9 como `history?around=` distingue mensagem de n\u00FAmero\n * de evento. Ausente = o servidor gera um `msg_\u2026`.\n */\n clientMessageId?: string;\n}\n\nexport namespace SendMessage {\n /**\n * Texto ou partes (`ContentPart[]`, do contract/events).\n */\n export type Content = string | SmoothAgentApi.EventsContentPart[];\n export const Mode = {\n Auto: \"auto\",\n Steer: \"steer\",\n Queue: \"queue\",\n } as const;\n export type Mode = (typeof Mode)[keyof typeof Mode];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nexport interface ChatsSendResponse {\n messageId: string;\n /** `duplicate` = este `clientMessageId` j\u00E1 estava no log (reenvio inofensivo; nada novo entrou). */\n status: ChatsSendResponse.Status;\n inboxVersion?: number | undefined;\n}\n\nexport namespace ChatsSendResponse {\n /** `duplicate` = este `clientMessageId` j\u00E1 estava no log (reenvio inofensivo; nada novo entrou). */\n export const Status = {\n Pending: \"pending\",\n Duplicate: \"duplicate\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport interface Agent {\n id: string;\n workspaceId: string;\n name: string;\n /**\n * O motor. Ausente = agente SEM motor (DESIGN \u00A714, 2026-11-01): roda com a credencial DO USU\u00C1RIO e o chat escolhe\n * entre os provedores que ele tem conectados (fixo no chat). Sem motor n\u00E3o aceita `credential`\n * (`{reason: connection_requires_provider}`) nem `model`/`allowedModels`/`providerOptions` (`{reason: provider_required}`).\n */\n provider?: SmoothAgentApi.EventsProvider | undefined;\n /** Id do modelo do provedor; ausente = padr\u00E3o da conta/assinatura. `id#esfor\u00E7o` vira o esfor\u00E7o. */\n model?: string | undefined;\n /** Recorte do que o usu\u00E1rio pode escolher por chat. Ausente = s\u00F3 `model`. */\n allowedModels?: string[] | undefined;\n systemPrompt?: string | undefined;\n mcp?: SmoothAgentApi.McpServer[] | undefined;\n limits?: SmoothAgentApi.AgentLimits | undefined;\n box?: SmoothAgentApi.BoxProfile | undefined;\n placement?: SmoothAgentApi.Placement | undefined;\n /**\n * O que `mode: 'auto'` faz com o agente trabalhando. Ausente na cria\u00E7\u00E3o = `queue` (decis\u00E3o do dono 2026-11-01: a\n * FILA \u00E9 o padr\u00E3o; `steer` \u2014 a experi\u00EAncia do terminal \u2014 \u00E9 escolha expl\u00EDcita; fila vazia come\u00E7a na hora), GRAVADO na config \u2014 a leitura sempre traz o valor. O mesmo padr\u00E3o em\n * todas as pontas (control, realtime, box).\n */\n queue?: Agent.Queue | undefined;\n hooks?: SmoothAgentApi.AgentHooks | undefined;\n /**\n * A credencial do WORKSPACE (uma conex\u00E3o) que roda o agente; vence a do usu\u00E1rio (\u00A79.7). ATEN\u00C7\u00C3O: p\u00F4r `credential` num\n * agente que j\u00E1 tem chats faz TODOS eles passarem a rodar com a conex\u00E3o no pr\u00F3ximo turno (e tirar faz voltarem pra a\n * credencial de cada usu\u00E1rio) \u2014 sem aviso aos usu\u00E1rios. Exige `provider` (agente sem motor = 400\n * `connection_requires_provider`).\n */\n credential?: SmoothAgentApi.AgentCredential | undefined;\n /** Op\u00E7\u00F5es nativas do provedor repassadas sem interpretar (permiss\u00F5es, sandbox\u2026). */\n providerOptions?: Record<string, unknown> | undefined;\n /**\n * Origens de navegador que podem usar o agente com token de USU\u00C1RIO (paridade v2 `allowed_origins`).\n * Ausente/vazio = qualquer uma. Fora da lista = `forbidden {reason:'origin_not_allowed'}`.\n */\n allowedOrigins?: string[] | undefined;\n /** Tema do agente (paridade v2), vis\u00EDvel pro usu\u00E1rio no `AgentPublic`. */\n theme?: SmoothAgentApi.AgentTheme | undefined;\n /** Tool nossa: o agente busca nos chats anteriores DESTE usu\u00E1rio com ESTE agente (MCP `smoothagent`). */\n memory?: boolean | undefined;\n /**\n * Tools nossas pro agente. `schedule`: criar/listar/cancelar agendamentos no pr\u00F3prio chat. `platform`\n * (s\u00F3 agente do workspace nativo da plataforma; fora dele \u00E9 ignorado): criar/configurar os agentes da conta do\n * usu\u00E1rio que conversa e ler o que \u00E9 dele.\n */\n tools?: Agent.Tools | undefined;\n metadata?: SmoothAgentApi.Metadata | undefined;\n /** Sobe a cada PATCH; vai no `ETag`. Os runs registram com qual revis\u00E3o rodaram. */\n revision: number;\n capabilities: SmoothAgentApi.EventsCapabilities;\n createdAt: SmoothAgentApi.Timestamp;\n updatedAt: SmoothAgentApi.Timestamp;\n}\n\nexport namespace Agent {\n /**\n * O que `mode: 'auto'` faz com o agente trabalhando. Ausente na cria\u00E7\u00E3o = `queue` (decis\u00E3o do dono 2026-11-01: a\n * FILA \u00E9 o padr\u00E3o; `steer` \u2014 a experi\u00EAncia do terminal \u2014 \u00E9 escolha expl\u00EDcita; fila vazia come\u00E7a na hora), GRAVADO na config \u2014 a leitura sempre traz o valor. O mesmo padr\u00E3o em\n * todas as pontas (control, realtime, box).\n */\n export interface Queue {\n defaultMode: Queue.DefaultMode;\n }\n\n export namespace Queue {\n export const DefaultMode = {\n Steer: \"steer\",\n Queue: \"queue\",\n } as const;\n export type DefaultMode = (typeof DefaultMode)[keyof typeof DefaultMode];\n }\n\n /**\n * Tools nossas pro agente. `schedule`: criar/listar/cancelar agendamentos no pr\u00F3prio chat. `platform`\n * (s\u00F3 agente do workspace nativo da plataforma; fora dele \u00E9 ignorado): criar/configurar os agentes da conta do\n * usu\u00E1rio que conversa e ler o que \u00E9 dele.\n */\n export interface Tools {\n schedule?: boolean | undefined;\n platform?: boolean | undefined;\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nexport interface BoxFileContent {\n path: string;\n /** `utf8` = texto; `base64` = bin\u00E1rio. */\n encoding: BoxFileContent.Encoding;\n content: string;\n sizeBytes: number;\n /** Arquivo maior que o teto (1 MB): veio s\u00F3 o come\u00E7o. */\n truncated: boolean;\n}\n\nexport namespace BoxFileContent {\n /** `utf8` = texto; `base64` = bin\u00E1rio. */\n export const Encoding = {\n Utf8: \"utf8\",\n Base64: \"base64\",\n } as const;\n export type Encoding = (typeof Encoding)[keyof typeof Encoding];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport interface BoxFileEntry {\n name: string;\n type: BoxFileEntry.Type;\n sizeBytes?: number | undefined;\n modifiedAt?: SmoothAgentApi.Timestamp | undefined;\n}\n\nexport namespace BoxFileEntry {\n export const Type = {\n File: \"file\",\n Dir: \"dir\",\n Symlink: \"symlink\",\n } as const;\n export type Type = (typeof Type)[keyof typeof Type];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport interface Chat {\n id: string;\n workspaceId: string;\n userId: string;\n /** O \u00DALTIMO agente usado \u2014 o que a pr\u00F3xima mensagem usa se ningu\u00E9m trocar. */\n agentId: string;\n provider: SmoothAgentApi.EventsProvider;\n /** Modelo fixado neste chat. Ausente = o padr\u00E3o do agente/da conta (o resolvido est\u00E1 em `/selection`). Nunca `null`. */\n model?: string | undefined;\n /** Esfor\u00E7o de racioc\u00EDnio, separado do modelo (P1). Ausente = padr\u00E3o. */\n effort?: string | undefined;\n /** Troca agendada esperando o run ativo completar. */\n scheduledSwitch: SmoothAgentApi.EventsScheduledSwitch | null;\n machineId: string;\n title: string | null;\n metadata: SmoothAgentApi.Metadata;\n /** Proje\u00E7\u00E3o pra lateral: vem do log, atualizada pelo ingest. */\n state: Chat.State;\n /** Cursor do \u00FAltimo evento: `String(seq)` (o que a SDK usa pra assinar). */\n lastEventId: string | null;\n lastEventSeq: number;\n /** Respostas do agente (runs fechados) depois do que esta pessoa marcou como lido (P8). */\n unreadCount: number;\n /** At\u00E9 onde esta pessoa leu (`String(seq)`), ou null se nunca marcou. */\n lastReadEventId: string | null;\n createdAt: SmoothAgentApi.Timestamp;\n updatedAt: SmoothAgentApi.Timestamp;\n}\n\nexport namespace Chat {\n /** Proje\u00E7\u00E3o pra lateral: vem do log, atualizada pelo ingest. */\n export const State = {\n Idle: \"idle\",\n Starting: \"starting\",\n Working: \"working\",\n Waiting: \"waiting\",\n } as const;\n export type State = (typeof State)[keyof typeof State];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\n/**\n * O chat apagado: some na hora; `pending` = a limpeza da box ainda corre (sem esperar o Detona), `done` = j\u00E1 foi.\n */\nexport interface ChatDeleted {\n id: string;\n deleted: boolean;\n cleanup: ChatDeleted.Cleanup;\n}\n\nexport namespace ChatDeleted {\n export const Cleanup = {\n Pending: \"pending\",\n Done: \"done\",\n } as const;\n export type Cleanup = (typeof Cleanup)[keyof typeof Cleanup];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Tudo o que o seletor da tela precisa, pronto.\n */\nexport interface ChatSelection {\n current: ChatSelection.Current;\n scheduledSwitch: SmoothAgentApi.EventsScheduledSwitch | null;\n /**\n * O que d\u00E1 pra escolher: os agentes que o usu\u00E1rio pode usar, cada um com S\u00D3 os modelos\n * conectados pra ele (credencial do agente > a do usu\u00E1rio). Agente sem credencial vem com\n * `ready: false` e `needs` (a tela oferece conectar), nunca escondido sem motivo.\n */\n options: SmoothAgentApi.AgentPublic[];\n /** `false` enquanto h\u00E1 run ativo: a troca seria agendada, n\u00E3o imediata. */\n switchableNow: boolean;\n}\n\nexport namespace ChatSelection {\n export interface Current {\n agentId: string;\n agentName: string | null;\n provider: SmoothAgentApi.EventsProvider;\n /** O modelo que VAI RODAR, resolvido (chat > agente > padr\u00E3o da credencial). Ausente s\u00F3 se o provedor n\u00E3o informou nenhum. */\n model?: string | undefined;\n modelName?: string | undefined;\n /** O modelo concreto em que o `model` (alias da assinatura) resolve agora, segundo o CLI. Ausente = `model` j\u00E1 \u00E9 concreto. */\n resolvedModel?: string | undefined;\n /** Esfor\u00E7o separado do modelo (P1). */\n effort?: string | undefined;\n /** De onde vem a credencial que roda este chat; null = nenhuma conectada. */\n credentialVia: Current.CredentialVia | null;\n }\n\n export namespace Current {\n export const CredentialVia = {\n Agent: \"agent\",\n Subscription: \"subscription\",\n Key: \"key\",\n } as const;\n export type CredentialVia = (typeof CredentialVia)[keyof typeof CredentialVia];\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Uma tarefa viva ou recente do chat: subagente ou processo de fundo do agente.\n */\nexport interface ChatTask {\n id: string;\n kind: ChatTask.Kind;\n /** O que o agente disse que \u00E9 (descri\u00E7\u00E3o do subagente, a linha de comando\u2026). */\n title: string;\n status: ChatTask.Status;\n /** O item do log que abriu a tarefa (pular pra ela no hist\u00F3rico). */\n itemId?: string | undefined;\n startedAt: SmoothAgentApi.Timestamp;\n endedAt?: SmoothAgentApi.Timestamp | undefined;\n exitCode?: number | undefined;\n}\n\nexport namespace ChatTask {\n export const Kind = {\n Subagent: \"subagent\",\n Command: \"command\",\n Monitor: \"monitor\",\n Terminal: \"terminal\",\n } as const;\n export type Kind = (typeof Kind)[keyof typeof Kind];\n export const Status = {\n Running: \"running\",\n Completed: \"completed\",\n Failed: \"failed\",\n Stopped: \"stopped\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\n/**\n * Uma op\u00E7\u00E3o de resposta a um pedido de aprova\u00E7\u00E3o (vocabul\u00E1rio do ACP).\n */\nexport interface EventsApprovalOption {\n /** Id. */\n id: string;\n /** R\u00F3tulo. */\n label?: string | undefined;\n /** ACP */\n kind: EventsApprovalOption.Kind;\n /** o que o \"sempre\" grava */\n detail?: unknown | undefined;\n}\n\nexport namespace EventsApprovalOption {\n /** ACP */\n export const Kind = {\n AllowOnce: \"allow_once\",\n AllowAlways: \"allow_always\",\n RejectOnce: \"reject_once\",\n RejectAlways: \"reject_always\",\n Other: \"other\",\n } as const;\n export type Kind = (typeof Kind)[keyof typeof Kind];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\n/**\n * O que o provedor suporta, declarado no initialize; vai em agent.get(). Versionado.\n */\nexport interface EventsCapabilities {\n version: number;\n /** Racioc\u00EDnio. */\n reasoning?: boolean | undefined;\n /** Mostra resumo do racioc\u00EDnio. */\n reasoningSummary?: boolean | undefined;\n /** Mostra plano (todo list). */\n plans?: boolean | undefined;\n /** Prop\u00F5e plano pra aprovar. */\n proposedPlans?: boolean | undefined;\n /** Pede aprova\u00E7\u00E3o. */\n approvals?: boolean | undefined;\n /** Perguntas. */\n questions?: boolean | undefined;\n /** Roda subagentes. */\n subagents?: boolean | undefined;\n /** Trabalho que segue depois do turno. */\n background?: boolean | undefined;\n /** o provedor abre turno sozinho quando uma tarefa acaba */\n wakeTurns?: boolean | undefined;\n /** Para uma tarefa sem parar o run. */\n taskStop?: boolean | undefined;\n /** Agenda (schedule_task). */\n timers?: boolean | undefined;\n /** Mostra mudan\u00E7a de arquivo. */\n fileChanges?: boolean | undefined;\n /** Quantidade de imagens. */\n images?: boolean | undefined;\n /** Lista/l\u00EA arquivos da box. */\n boxFiles?: boolean | undefined;\n /** Informa a janela de contexto. */\n contextUsage?: boolean | undefined;\n /** Informa os limites. */\n usageLimits?: boolean | undefined;\n /** Informa custo. */\n costReporting?: boolean | undefined;\n /** Roda tools em paralelo. */\n parallelTools?: boolean | undefined;\n /** Como entra mensagem com turno rodando: native (steer do provedor), restart (interrompe e reinicia) ou none. */\n steering: EventsCapabilities.Steering;\n /** onde o steer nativo entra */\n steerBoundary?: EventsCapabilities.SteerBoundary | undefined;\n /** retirar steer entregue e n\u00E3o lido: Claude interrupt{cancel_queued} = sim */\n steerRecall?: boolean | undefined;\n /** Codex: espera o turno */\n steerDuringCompaction?: EventsCapabilities.SteerDuringCompaction | undefined;\n /** o que o steer nativo corta: nada (Claude next: espera a tool), a resposta em curso (Codex 0.163: o adaptador fecha o item interrupted antes do message.consumed), ou tools em andamento */\n steerInterrupts?: EventsCapabilities.SteerInterrupts | undefined;\n /** Como o STOP para o turno: native (pedido ao provedor) ou kill (mata o processo). */\n interrupt?: EventsCapabilities.Interrupt | undefined;\n /** Como sabemos que o provedor leu a mensagem: echo, item ou order. */\n consumptionSignal?: EventsCapabilities.ConsumptionSignal | undefined;\n /** O que chega em peda\u00E7os (deltas) enquanto o item est\u00E1 aberto. */\n streaming?: EventsCapabilities.Streaming | undefined;\n /** Troca de modelo na mesma sess\u00E3o. */\n modelSwitchInSession?: boolean | undefined;\n /** troca dos servidores MCP (config do agente): live = setMcpServers no processo vivo, mesma sess\u00E3o, s\u00F3 entre turnos (Claude mcp_set_servers); restart = a box reinicia o processo com resume; none/ausente = idem restart */\n mcpSwitch?: EventsCapabilities.McpSwitch | undefined;\n /** troca de esfor\u00E7o: live = na mesma sess\u00E3o, vale a partir do PR\u00D3XIMO turno, nunca no meio de um (Claude apply_flag_settings{effortLevel}, Codex por turn/start); restart = precisa reiniciar o processo (com --resume); none = n\u00E3o troca */\n effortSwitch?: EventsCapabilities.EffortSwitch | undefined;\n /** Retomar a sess\u00E3o nativa. */\n resume?: boolean | undefined;\n /** como recebe o hist\u00F3rico numa troca de provedor (Claude: .jsonl sint\u00E9tico + --resume) */\n handoffInject?: EventsCapabilities.HandoffInject | undefined;\n}\n\nexport namespace EventsCapabilities {\n /** Como entra mensagem com turno rodando: native (steer do provedor), restart (interrompe e reinicia) ou none. */\n export const Steering = {\n Native: \"native\",\n Restart: \"restart\",\n None: \"none\",\n } as const;\n export type Steering = (typeof Steering)[keyof typeof Steering];\n /** onde o steer nativo entra */\n export const SteerBoundary = {\n Tool: \"tool\",\n ModelCall: \"model_call\",\n Turn: \"turn\",\n } as const;\n export type SteerBoundary = (typeof SteerBoundary)[keyof typeof SteerBoundary];\n /** Codex: espera o turno */\n export const SteerDuringCompaction = {\n Joins: \"joins\",\n WaitsTurn: \"waits_turn\",\n } as const;\n export type SteerDuringCompaction = (typeof SteerDuringCompaction)[keyof typeof SteerDuringCompaction];\n /** o que o steer nativo corta: nada (Claude next: espera a tool), a resposta em curso (Codex 0.163: o adaptador fecha o item interrupted antes do message.consumed), ou tools em andamento */\n export const SteerInterrupts = {\n Nothing: \"nothing\",\n Response: \"response\",\n Tools: \"tools\",\n } as const;\n export type SteerInterrupts = (typeof SteerInterrupts)[keyof typeof SteerInterrupts];\n /** Como o STOP para o turno: native (pedido ao provedor) ou kill (mata o processo). */\n export const Interrupt = {\n Native: \"native\",\n Kill: \"kill\",\n } as const;\n export type Interrupt = (typeof Interrupt)[keyof typeof Interrupt];\n /** Como sabemos que o provedor leu a mensagem: echo, item ou order. */\n export const ConsumptionSignal = {\n Echo: \"echo\",\n Item: \"item\",\n Order: \"order\",\n } as const;\n export type ConsumptionSignal = (typeof ConsumptionSignal)[keyof typeof ConsumptionSignal];\n\n /**\n * O que chega em peda\u00E7os (deltas) enquanto o item est\u00E1 aberto.\n */\n export interface Streaming {\n /** Texto. */\n text?: boolean | undefined;\n /** Racioc\u00EDnio. */\n reasoning?: boolean | undefined;\n /** Entrada da tool em peda\u00E7os. */\n toolInput?: boolean | undefined;\n /** Sa\u00EDda de comando em peda\u00E7os. */\n commandOutput?: boolean | undefined;\n /** Texto do plano em peda\u00E7os. */\n planText?: boolean | undefined;\n }\n\n /** troca dos servidores MCP (config do agente): live = setMcpServers no processo vivo, mesma sess\u00E3o, s\u00F3 entre turnos (Claude mcp_set_servers); restart = a box reinicia o processo com resume; none/ausente = idem restart */\n export const McpSwitch = {\n Live: \"live\",\n Restart: \"restart\",\n None: \"none\",\n } as const;\n export type McpSwitch = (typeof McpSwitch)[keyof typeof McpSwitch];\n /** troca de esfor\u00E7o: live = na mesma sess\u00E3o, vale a partir do PR\u00D3XIMO turno, nunca no meio de um (Claude apply_flag_settings{effortLevel}, Codex por turn/start); restart = precisa reiniciar o processo (com --resume); none = n\u00E3o troca */\n export const EffortSwitch = {\n Live: \"live\",\n Restart: \"restart\",\n None: \"none\",\n } as const;\n export type EffortSwitch = (typeof EffortSwitch)[keyof typeof EffortSwitch];\n /** como recebe o hist\u00F3rico numa troca de provedor (Claude: .jsonl sint\u00E9tico + --resume) */\n export const HandoffInject = {\n NativeHistory: \"native_history\",\n ContextMessage: \"context_message\",\n None: \"none\",\n } as const;\n export type HandoffInject = (typeof HandoffInject)[keyof typeof HandoffInject];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\n/**\n * anexo a um campo string do item aberto\n */\nexport interface EventsDelta {\n /** Caminho do arquivo. */\n path: EventsDelta.Path;\n /** \u00CDndice no array. */\n index?: number | undefined;\n /** Texto a anexar. */\n append: string;\n}\n\nexport namespace EventsDelta {\n /** Caminho do arquivo. */\n export const Path = {\n Text: \"text\",\n Summary: \"summary\",\n InputText: \"inputText\",\n Output: \"output\",\n } as const;\n export type Path = (typeof Path)[keyof typeof Path];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\n/**\n * Dados (`data`) do evento `chat.state`.\n */\nexport interface EventsEChatStateData {\n /** Estado do chat: idle (parado), starting (pedido aceito, provedor ainda n\u00E3o come\u00E7ou), working (rodando), waiting (esperando resposta do usu\u00E1rio). */\n state: EventsEChatStateData.State;\n}\n\nexport namespace EventsEChatStateData {\n /** Estado do chat: idle (parado), starting (pedido aceito, provedor ainda n\u00E3o come\u00E7ou), working (rodando), waiting (esperando resposta do usu\u00E1rio). */\n export const State = {\n Idle: \"idle\",\n Starting: \"starting\",\n Working: \"working\",\n Waiting: \"waiting\",\n } as const;\n export type State = (typeof State)[keyof typeof State];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Dados (`data`) do evento `item.retracted`.\n */\nexport interface EventsEItemRetractedData {\n /** Por que o item saiu: superseded (outro o substitui), provider_rewrite ou rollback. */\n reason?: EventsEItemRetractedData.Reason | undefined;\n supersededBy?: SmoothAgentApi.EventsItemId | undefined;\n}\n\nexport namespace EventsEItemRetractedData {\n /** Por que o item saiu: superseded (outro o substitui), provider_rewrite ou rollback. */\n export const Reason = {\n Superseded: \"superseded\",\n ProviderRewrite: \"provider_rewrite\",\n Rollback: \"rollback\",\n } as const;\n export type Reason = (typeof Reason)[keyof typeof Reason];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\n/**\n * Dados (`data`) do evento `notice`.\n */\nexport interface EventsENoticeData {\n /** Gravidade do aviso. */\n level: EventsENoticeData.Level;\n /** C\u00F3digo do aviso (ex.: mcp_unavailable). */\n code?: string | undefined;\n /** Texto do aviso pra tela. */\n message: string;\n}\n\nexport namespace EventsENoticeData {\n /** Gravidade do aviso. */\n export const Level = {\n Info: \"info\",\n Warning: \"warning\",\n } as const;\n export type Level = (typeof Level)[keyof typeof Level];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Dados (`data`) do evento `run.completed`.\n */\nexport interface EventsERunCompletedData {\n runId: SmoothAgentApi.EventsRunId;\n /** Como o run fechou: completed, stopped (STOP) ou failed. */\n status: EventsERunCompletedData.Status;\n /** Tentativas feitas. */\n attempts?: number | undefined;\n usage?: SmoothAgentApi.EventsUsage | undefined;\n error?: SmoothAgentApi.EventsFailure | undefined;\n /** O STOP que fechou. */\n stop?: EventsERunCompletedData.Stop | undefined;\n /** nativo da \u00FAltima chamada: end_turn, max_tokens\u2026 */\n stopReason?: string | undefined;\n /** Dura\u00E7\u00E3o em milissegundos. */\n durationMs?: number | undefined;\n}\n\nexport namespace EventsERunCompletedData {\n /** Como o run fechou: completed, stopped (STOP) ou failed. */\n export const Status = {\n Completed: \"completed\",\n Stopped: \"stopped\",\n Failed: \"failed\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n\n /**\n * O STOP que fechou.\n */\n export interface Stop {\n stopId?: SmoothAgentApi.EventsStopId | undefined;\n by?: SmoothAgentApi.EventsOrigin | undefined;\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Dados (`data`) do evento `run.started`.\n */\nexport interface EventsERunStartedData {\n runId: SmoothAgentApi.EventsRunId;\n /** Tentativa deste run (1 = a primeira; sobe em retry e auth_retry). */\n attempt: number;\n /** Por que esta tentativa abriu: initial, steer_restart (steer que reinicia), retry (erro recuper\u00E1vel), auth_retry (depois do 401, M1). */\n reason: EventsERunStartedData.Reason;\n trigger: SmoothAgentApi.EventsRunTrigger;\n agent: SmoothAgentApi.EventsRunAgent;\n}\n\nexport namespace EventsERunStartedData {\n /** Por que esta tentativa abriu: initial, steer_restart (steer que reinicia), retry (erro recuper\u00E1vel), auth_retry (depois do 401, M1). */\n export const Reason = {\n Initial: \"initial\",\n SteerRestart: \"steer_restart\",\n Retry: \"retry\",\n AuthRetry: \"auth_retry\",\n } as const;\n export type Reason = (typeof Reason)[keyof typeof Reason];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Dados (`data`) do evento `run.waiting`.\n */\nexport interface EventsERunWaitingData {\n /** O que o run espera: input (aprova\u00E7\u00E3o/pergunta), task (tarefa em background) ou timer (agendamento). */\n reason: EventsERunWaitingData.Reason;\n /** Pedidos (aprova\u00E7\u00E3o/pergunta) envolvidos. */\n requestIds?: SmoothAgentApi.EventsRequestId[] | undefined;\n /** Tarefas envolvidas. */\n taskIds?: SmoothAgentApi.EventsTaskId[] | undefined;\n wakeAt?: SmoothAgentApi.EventsTimestamp | undefined;\n}\n\nexport namespace EventsERunWaitingData {\n /** O que o run espera: input (aprova\u00E7\u00E3o/pergunta), task (tarefa em background) ou timer (agendamento). */\n export const Reason = {\n Input: \"input\",\n Task: \"task\",\n Timer: \"timer\",\n } as const;\n export type Reason = (typeof Reason)[keyof typeof Reason];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Dados (`data`) do evento `session.started`.\n */\nexport interface EventsESessionStartedData {\n provider: SmoothAgentApi.EventsProvider;\n /** Modelo da sess\u00E3o, quando o provedor informa. */\n model?: string | undefined;\n /** true = retomou a sess\u00E3o nativa existente (resume); false = sess\u00E3o nova. */\n resumed: boolean;\n /** session_lost = a sess\u00E3o nativa sumiu (conta reconectada, chat noutra m\u00E1quina): sess\u00E3o NOVA do mesmo provedor, reinjetada com o hist\u00F3rico do log */\n reason?: EventsESessionStartedData.Reason | undefined;\n agent?: SmoothAgentApi.EventsAgentSelection | undefined;\n /** reason=reset com clearHistory (R7): o reducer tira do estado os itens FECHADOS, os runs e as tarefas fechadas; mant\u00E9m selection, usage, limits, context e o que est\u00E1 aberto */\n clearHistory?: boolean | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n /** Vers\u00E3o do engine do provedor. */\n providerVersion?: string | undefined;\n /** Servidores MCP e o estado de cada um. */\n mcpServers?: EventsESessionStartedData.McpServers.Item[] | undefined;\n /** Quantidade de tools. */\n tools?: number | undefined;\n}\n\nexport namespace EventsESessionStartedData {\n /** session_lost = a sess\u00E3o nativa sumiu (conta reconectada, chat noutra m\u00E1quina): sess\u00E3o NOVA do mesmo provedor, reinjetada com o hist\u00F3rico do log */\n export const Reason = {\n First: \"first\",\n Reset: \"reset\",\n Switch: \"switch\",\n SessionLost: \"session_lost\",\n ProcessRestart: \"process_restart\",\n Resume: \"resume\",\n } as const;\n export type Reason = (typeof Reason)[keyof typeof Reason];\n export type McpServers = McpServers.Item[];\n\n export namespace McpServers {\n export interface Item {\n /** Nome. */\n name: string;\n /** Estado. */\n status: string;\n /** Quantidade de tools. */\n tools?: number | undefined;\n }\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\n/**\n * o que foi reinjetado na sess\u00E3o nova\n */\nexport interface EventsHandoffInjected {\n /** primeiro evento reinjetado */\n fromSeq?: number | undefined;\n /** \u00FAltimo */\n toSeq?: number | undefined;\n /** Mensagens. */\n messages?: number | undefined;\n /** Quantidade de itens. */\n items?: number | undefined;\n /** medido ou estimado \u2014 ver estimated */\n tokens?: number | undefined;\n /** tokens \u00E9 estimativa do adaptador, n\u00E3o contagem do provedor */\n estimated?: boolean | undefined;\n /** Quantidade de imagens. */\n images?: number | undefined;\n /** Por onde. */\n via?: EventsHandoffInjected.Via | undefined;\n}\n\nexport namespace EventsHandoffInjected {\n /** Por onde. */\n export const Via = {\n NativeHistory: \"native_history\",\n ContextMessage: \"context_message\",\n } as const;\n export type Via = (typeof Via)[keyof typeof Via];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\n/**\n * o que N\u00C3O passou\n */\nexport interface EventsHandoffLost {\n /** Primeiro seq. */\n fromSeq?: number | undefined;\n /** \u00DAltimo seq. */\n toSeq?: number | undefined;\n /** Quantidade de itens. */\n items?: number | undefined;\n /** Quantidade de imagens. */\n images?: number | undefined;\n /** Motivo. */\n reason?: EventsHandoffLost.Reason | undefined;\n}\n\nexport namespace EventsHandoffLost {\n /** Motivo. */\n export const Reason = {\n Budget: \"budget\",\n SummarizerUnavailable: \"summarizer_unavailable\",\n UnsupportedContent: \"unsupported_content\",\n } as const;\n export type Reason = (typeof Reason)[keyof typeof Reason];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Uma mensagem na inbox (pendente, na fila ou n\u00E3o entregue), antes de o provedor ler.\n */\nexport interface EventsInboxEntry {\n messageId: SmoothAgentApi.EventsMessageId;\n /** Id do lado do cliente (idempot\u00EAncia). */\n clientMessageId?: string | undefined;\n /** Conte\u00FAdo da mensagem. */\n content: SmoothAgentApi.EventsContentPart[];\n /** Como a mensagem entra: auto (come\u00E7a ou vira steer), steer (no turno em andamento) ou queue (fila). */\n mode: EventsInboxEntry.Mode;\n origin: SmoothAgentApi.EventsOrigin;\n createdAt: SmoothAgentApi.EventsTimestamp;\n /** taken = a box pegou (o \"visto\"); some da inbox quando o provedor L\u00CA (vira user_message no seq) */\n status?: EventsInboxEntry.Status | undefined;\n /** a box pegou mas o provedor n\u00E3o pode ler agora (Codex compactando: espera o turno) */\n waitingFor?: EventsInboxEntry.WaitingFor | undefined;\n /** s\u00F3 em notDelivered: not_consumed = a box pediu pra dormir v\u00E1rias vezes sem o provedor ler (o teto). Ausente = STOP antes do turno. Valor desconhecido = mostrar gen\u00E9rico */\n notDeliveredReason?: EventsInboxEntry.NotDeliveredReason | undefined;\n /** steer n\u00E3o lido no STOP voltou pro topo */\n requeued?: boolean | undefined;\n editedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n}\n\nexport namespace EventsInboxEntry {\n /** Como a mensagem entra: auto (come\u00E7a ou vira steer), steer (no turno em andamento) ou queue (fila). */\n export const Mode = {\n Auto: \"auto\",\n Steer: \"steer\",\n Queue: \"queue\",\n } as const;\n export type Mode = (typeof Mode)[keyof typeof Mode];\n /** taken = a box pegou (o \"visto\"); some da inbox quando o provedor L\u00CA (vira user_message no seq) */\n export const Status = {\n Pending: \"pending\",\n Taken: \"taken\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n /** a box pegou mas o provedor n\u00E3o pode ler agora (Codex compactando: espera o turno) */\n export const WaitingFor = {\n Compaction: \"compaction\",\n TurnEnd: \"turn_end\",\n } as const;\n export type WaitingFor = (typeof WaitingFor)[keyof typeof WaitingFor];\n /** s\u00F3 em notDelivered: not_consumed = a box pediu pra dormir v\u00E1rias vezes sem o provedor ler (o teto). Ausente = STOP antes do turno. Valor desconhecido = mostrar gen\u00E9rico */\n export const NotDeliveredReason = {\n NotConsumed: \"not_consumed\",\n } as const;\n export type NotDeliveredReason = (typeof NotDeliveredReason)[keyof typeof NotDeliveredReason];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * DEPRECATED (use QueueState). Pendentes, fila, STOP pendente, troca agendada \u2014 dono: o log. Duas trocas: a segunda SUBSTITUI a agendada (baseVersion; velha = conflict).\n */\nexport interface EventsInboxState {\n /** vers\u00E3o pr\u00F3pria da inbox (ordem dos comandos; base do conflict) */\n version: number;\n /** auto/steer ainda n\u00E3o lidos */\n pending: SmoothAgentApi.EventsInboxEntry[];\n /** a fila vis\u00EDvel, em ordem */\n queue: SmoothAgentApi.EventsInboxEntry[];\n /** STOP antes do turno: reenviar/descartar */\n notDelivered: SmoothAgentApi.EventsInboxEntry[];\n /** Respostas gravadas. */\n responses?: EventsInboxState.Responses.Item[] | undefined;\n stopPending?: SmoothAgentApi.EventsStopId | undefined;\n /** fila parada: s\u00F3 anda quando o usu\u00E1rio manda algo/enviar agora */\n held?: EventsInboxState.Held | undefined;\n scheduledSwitch?: SmoothAgentApi.EventsScheduledSwitch | undefined;\n}\n\nexport namespace EventsInboxState {\n export type Responses = Responses.Item[];\n\n export namespace Responses {\n export interface Item {\n requestId: SmoothAgentApi.EventsRequestId;\n answer?: unknown | undefined;\n origin: SmoothAgentApi.EventsOrigin;\n }\n }\n\n /**\n * fila parada: s\u00F3 anda quando o usu\u00E1rio manda algo/enviar agora\n */\n export interface Held {\n /** Motivo. */\n reason: Held.Reason;\n since?: SmoothAgentApi.EventsTimestamp | undefined;\n }\n\n export namespace Held {\n /** Motivo. */\n export const Reason = {\n Stop: \"stop\",\n Limit: \"limit\",\n NoCredit: \"no_credit\",\n Auth: \"auth\",\n Error: \"error\",\n WakeFailed: \"wake_failed\",\n } as const;\n export type Reason = (typeof Reason)[keyof typeof Reason];\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `approval`: o agente pede permiss\u00E3o pra uma a\u00E7\u00E3o (comando, edi\u00E7\u00E3o, ferramenta) e o turno para em run.waiting. A tela mostra o cart\u00E3o com a a\u00E7\u00E3o e as op\u00E7\u00F5es; a resposta vai por `respond` com o requestId, e o item fecha com a decis\u00E3o.\n */\nexport interface EventsItemApproval {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemApproval.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n requestId?: SmoothAgentApi.EventsRequestId | undefined;\n targetItemId?: SmoothAgentApi.EventsItemId | undefined;\n /** O que o agente quer fazer. */\n action?: EventsItemApproval.Action | undefined;\n /** As op\u00E7\u00F5es de resposta. */\n options?: SmoothAgentApi.EventsApprovalOption[] | undefined;\n /** A resposta dada (presente depois de respondido). */\n decision?: EventsItemApproval.Decision | undefined;\n /** false = callback morreu (cold) \u2192 request_expired */\n respondable?: boolean | undefined;\n}\n\nexport namespace EventsItemApproval {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n\n /**\n * O que o agente quer fazer.\n */\n export interface Action {\n /** Tipo (discriminador). */\n kind: Action.Kind;\n /** Linha de comando. */\n command?: string | undefined;\n /** Pasta de trabalho. */\n cwd?: string | undefined;\n /** Arquivos. */\n paths?: string[] | undefined;\n /** Nome da tool. */\n toolName?: string | undefined;\n /** Entrada (JSON). */\n input?: unknown | undefined;\n /** Motivo. */\n reason?: string | undefined;\n }\n\n export namespace Action {\n /** Tipo (discriminador). */\n export const Kind = {\n Command: \"command\",\n FileChange: \"file_change\",\n Tool: \"tool\",\n Network: \"network\",\n Permissions: \"permissions\",\n Other: \"other\",\n } as const;\n export type Kind = (typeof Kind)[keyof typeof Kind];\n }\n\n /**\n * A resposta dada (presente depois de respondido).\n */\n export interface Decision {\n /** Op\u00E7\u00E3o escolhida. */\n optionId: string;\n /** Tipo (discriminador). */\n kind?: string | undefined;\n /** Coment\u00E1rio do usu\u00E1rio junto da resposta. */\n feedback?: string | undefined;\n by?: SmoothAgentApi.EventsOrigin | undefined;\n at?: SmoothAgentApi.EventsTimestamp | undefined;\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `command`: o agente roda um comando de shell; a sa\u00EDda chega por item.delta e o item fecha com o exitCode (ou segue em background como tarefa). A tela mostra o comando, a sa\u00EDda ao vivo e o c\u00F3digo de sa\u00EDda.\n */\nexport interface EventsItemCommand {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemCommand.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n /** Linha de comando. */\n command?: string | undefined;\n /** Descri\u00E7\u00E3o. */\n description?: string | undefined;\n /** Pasta de trabalho. */\n cwd?: string | undefined;\n /** Sa\u00EDda. */\n output?: string | undefined;\n /** C\u00F3digo de sa\u00EDda. */\n exitCode?: number | undefined;\n /** Dura\u00E7\u00E3o em milissegundos. */\n durationMs?: number | undefined;\n /** Id do processo. */\n processId?: string | undefined;\n /** \u00C9 um monitor (vigia em background). */\n monitor?: boolean | undefined;\n /** Codex commandActions */\n actions?: EventsItemCommand.Actions.Item[] | undefined;\n /** Origem. */\n source?: string | undefined;\n /** Entrada da tool como texto (JSON parcial durante o stream). */\n inputText?: string | undefined;\n}\n\nexport namespace EventsItemCommand {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n export type Actions = Actions.Item[];\n\n export namespace Actions {\n export interface Item {\n /** Tipo (discriminador). */\n type: string;\n /** Caminho do arquivo. */\n path?: string | undefined;\n /** Consulta. */\n query?: string | undefined;\n /** Linha de comando. */\n command?: string | undefined;\n }\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `compaction`: o provedor compactou o contexto (sozinho ou pedido), com tokens antes/depois e o resumo. A tela mostra um divisor \"contexto resumido\".\n */\nexport interface EventsItemCompaction {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemCompaction.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n /** auto (o provedor compactou sozinho) ou manual. */\n trigger?: EventsItemCompaction.Trigger | undefined;\n /** Tokens antes. */\n beforeTokens?: number | undefined;\n /** Tokens depois. */\n afterTokens?: number | undefined;\n /** Resumo. */\n summary?: string | undefined;\n /** Dura\u00E7\u00E3o em milissegundos. */\n durationMs?: number | undefined;\n}\n\nexport namespace EventsItemCompaction {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n /** auto (o provedor compactou sozinho) ou manual. */\n export const Trigger = {\n Auto: \"auto\",\n Manual: \"manual\",\n } as const;\n export type Trigger = (typeof Trigger)[keyof typeof Trigger];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `error`: um erro que fica registrado NA timeline, no ponto em que aconteceu (c\u00F3digo de erro e mensagem pronta). A tela mostra o erro em linha; o turno pode seguir ou fechar depois.\n */\nexport interface EventsItemError {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemError.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n error?: SmoothAgentApi.EventsFailure | undefined;\n}\n\nexport namespace EventsItemError {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `file_change`: o agente criou, editou ou apagou arquivos. A tela mostra a lista de arquivos com o diff (adi\u00E7\u00F5es/remo\u00E7\u00F5es).\n */\nexport interface EventsItemFileChange {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemFileChange.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n /** LISTA: um item do Codex muda v\u00E1rios arquivos */\n changes?: EventsItemFileChange.Changes.Item[] | undefined;\n /** Nome da tool. */\n tool?: string | undefined;\n output?: SmoothAgentApi.EventsToolOutput | undefined;\n /** Entrada da tool como texto (JSON parcial durante o stream). */\n inputText?: string | undefined;\n}\n\nexport namespace EventsItemFileChange {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n export type Changes = Changes.Item[];\n\n export namespace Changes {\n export interface Item {\n /** Caminho do arquivo. */\n path: string;\n /** Opera\u00E7\u00E3o. */\n op: Item.Op;\n /** Caminho antigo (move). */\n oldPath?: string | undefined;\n /** Diff unificado. */\n diff?: string | undefined;\n /** Linhas adicionadas. */\n additions?: number | undefined;\n /** Linhas removidas. */\n deletions?: number | undefined;\n }\n\n export namespace Item {\n /** Opera\u00E7\u00E3o. */\n export const Op = {\n Create: \"create\",\n Edit: \"edit\",\n Delete: \"delete\",\n Move: \"move\",\n } as const;\n export type Op = (typeof Op)[keyof typeof Op];\n }\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `file_search`: o agente buscou arquivos ou conte\u00FAdo (glob/grep). A tela mostra o padr\u00E3o, o caminho e os resultados.\n */\nexport interface EventsItemFileSearch {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemFileSearch.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n /** Nome da tool. */\n tool?: string | undefined;\n /** Padr\u00E3o buscado. */\n pattern?: string | undefined;\n /** Caminho do arquivo. */\n path?: string | undefined;\n /** Resultados. */\n results?: EventsItemFileSearch.Results.Item[] | undefined;\n output?: SmoothAgentApi.EventsToolOutput | undefined;\n /** Entrada da tool como texto (JSON parcial durante o stream). */\n inputText?: string | undefined;\n}\n\nexport namespace EventsItemFileSearch {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n export type Results = Results.Item[];\n\n export namespace Results {\n export interface Item {\n /** Caminho do arquivo. */\n path: string;\n /** Linha. */\n line?: number | undefined;\n /** Trecho da linha. */\n preview?: string | undefined;\n }\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `handoff`: na troca de agente/provedor, registra como o contexto passou pro agente novo (estrat\u00E9gia, o que foi reinjetado, o resumo do que n\u00E3o coube). A tela mostra um divisor da passagem, com o resumo aberto pra ler.\n */\nexport interface EventsItemHandoff {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemHandoff.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n from?: SmoothAgentApi.EventsAgentSelection | undefined;\n to?: SmoothAgentApi.EventsAgentSelection | undefined;\n /** como o contexto passou */\n strategy?: EventsItemHandoff.Strategy | undefined;\n injected?: SmoothAgentApi.EventsHandoffInjected | undefined;\n /** o resumo do que n\u00E3o coube (registrado, nunca escondido) */\n summary?: string | undefined;\n /** quem escreveu o resumo (o provedor que SAIU, por padr\u00E3o) */\n summarizedBy?: SmoothAgentApi.EventsAgentSelection | undefined;\n lost?: SmoothAgentApi.EventsHandoffLost | undefined;\n switchId?: SmoothAgentApi.EventsSwitchId | undefined;\n /** por que houve reinje\u00E7\u00E3o: troca de agente/provedor, ou sess\u00E3o nativa perdida (from = to = o pr\u00F3prio agente) */\n reason?: EventsItemHandoff.Reason | undefined;\n}\n\nexport namespace EventsItemHandoff {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n /** como o contexto passou */\n export const Strategy = {\n FullHistory: \"full_history\",\n FullSummary: \"full_summary\",\n HistoryAndSummary: \"history_and_summary\",\n None: \"none\",\n } as const;\n export type Strategy = (typeof Strategy)[keyof typeof Strategy];\n /** por que houve reinje\u00E7\u00E3o: troca de agente/provedor, ou sess\u00E3o nativa perdida (from = to = o pr\u00F3prio agente) */\n export const Reason = {\n Switch: \"switch\",\n SessionLost: \"session_lost\",\n } as const;\n export type Reason = (typeof Reason)[keyof typeof Reason];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `hook`: um hook configurado rodou num evento do agente (antes/depois de tool, fim de turno\u2026). A tela mostra o nome, o resultado e a sa\u00EDda, normalmente recolhido.\n */\nexport interface EventsItemHook {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemHook.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n /** Nome do hook. */\n name?: string | undefined;\n /** Evento que disparou o hook. */\n event?: string | undefined;\n /** Resultado do hook. */\n outcome?: string | undefined;\n /** C\u00F3digo de sa\u00EDda. */\n exitCode?: number | undefined;\n /** Sa\u00EDda. */\n output?: string | undefined;\n}\n\nexport namespace EventsItemHook {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `notification`: uma notifica\u00E7\u00E3o entrou no chat sem ser do usu\u00E1rio (tarefa em background terminou, agendamento disparou, outro agente, sistema). A tela mostra como linha de sistema com a origem.\n */\nexport interface EventsItemNotification {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemNotification.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n /** Origem. */\n source?: EventsItemNotification.Source | undefined;\n /** Texto. */\n text?: string | undefined;\n}\n\nexport namespace EventsItemNotification {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n\n /**\n * Origem.\n */\n export interface Source {\n /** Tipo (discriminador). */\n kind: Source.Kind;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** O agendamento. */\n scheduleId?: string | undefined;\n /** Nome. */\n name?: string | undefined;\n }\n\n export namespace Source {\n /** Tipo (discriminador). */\n export const Kind = {\n Task: \"task\",\n Schedule: \"schedule\",\n Peer: \"peer\",\n System: \"system\",\n } as const;\n export type Kind = (typeof Kind)[keyof typeof Kind];\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `plan`: a lista de passos (to-do) que o agente mant\u00E9m durante o trabalho; atualiza enquanto ele avan\u00E7a. A tela mostra os passos com o estado de cada um.\n */\nexport interface EventsItemPlan {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemPlan.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n /** Passos do plano, em ordem. */\n steps?: EventsItemPlan.Steps.Item[] | undefined;\n /** Explica\u00E7\u00E3o. */\n explanation?: string | undefined;\n /** Entrada da tool como texto (JSON parcial durante o stream). */\n inputText?: string | undefined;\n}\n\nexport namespace EventsItemPlan {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n export type Steps = Steps.Item[];\n\n export namespace Steps {\n export interface Item {\n /** Texto. */\n text: string;\n /** Texto do passo em andamento. */\n activeText?: string | undefined;\n /** Estado. */\n status: Item.Status;\n }\n\n export namespace Item {\n /** Estado. */\n export const Status = {\n Pending: \"pending\",\n InProgress: \"in_progress\",\n Completed: \"completed\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n }\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `proposed_plan`: um plano que o agente PROP\u00D5E antes de executar (modo plano). A tela mostra o plano pra o usu\u00E1rio ler e decidir o que mandar em seguida.\n */\nexport interface EventsItemProposedPlan {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemProposedPlan.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n /** Texto. */\n text?: string | undefined;\n /** Entrada da tool como texto (JSON parcial durante o stream). */\n inputText?: string | undefined;\n}\n\nexport namespace EventsItemProposedPlan {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `question`: o agente faz uma ou mais perguntas ao usu\u00E1rio e o turno para em run.waiting. A tela mostra o formul\u00E1rio; a resposta vai por `respond` com o requestId, e o item fecha com as respostas.\n */\nexport interface EventsItemQuestion {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemQuestion.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n requestId?: SmoothAgentApi.EventsRequestId | undefined;\n /** As perguntas, em ordem. */\n questions?: EventsItemQuestion.Questions.Item[] | undefined;\n /** Respostas por id de pergunta. */\n answers?: Record<string, string[]> | undefined;\n answeredBy?: SmoothAgentApi.EventsOrigin | undefined;\n /** Ainda d\u00E1 pra responder (false = pedido morreu num acordar cold). */\n respondable?: boolean | undefined;\n /** Resolve sozinho depois disso (ms). */\n autoResolveMs?: number | undefined;\n /** O turno espera a resposta. */\n blocking?: boolean | undefined;\n}\n\nexport namespace EventsItemQuestion {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n export type Questions = Questions.Item[];\n\n export namespace Questions {\n export interface Item {\n /** Id. */\n id: string;\n /** T\u00EDtulo curto da pergunta. */\n header?: string | undefined;\n /** Texto. */\n text: string;\n /** Op\u00E7\u00F5es. */\n options?: Item.Options.Item[] | undefined;\n /** Aceita v\u00E1rias op\u00E7\u00F5es. */\n multiSelect?: boolean | undefined;\n /** Aceita resposta livre. */\n allowOther?: boolean | undefined;\n /** Resposta \u00E9 segredo (n\u00E3o mostrar nem logar). */\n secret?: boolean | undefined;\n }\n\n export namespace Item {\n export type Options = Options.Item[];\n\n export namespace Options {\n export interface Item {\n /** R\u00F3tulo. */\n label: string;\n /** Descri\u00E7\u00E3o. */\n description?: string | undefined;\n }\n }\n }\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `reasoning`: o racioc\u00EDnio do modelo, quando o provedor exp\u00F5e (texto ou s\u00F3 resumo; pode vir escondido). A tela mostra recolhido (\"pensando\u2026\") e deixa abrir.\n */\nexport interface EventsItemReasoning {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemReasoning.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n /** Texto. */\n text?: string | undefined;\n /** Resumo. */\n summary?: string[] | undefined;\n /** O provedor escondeu o conte\u00FAdo. */\n redacted?: boolean | undefined;\n /** Tokens estimados. */\n estimatedTokens?: number | undefined;\n}\n\nexport namespace EventsItemReasoning {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `subagent`: o agente abriu um subagente com uma tarefa; os itens do subagente v\u00EAm com parentItemId apontando pra c\u00E1 e o progresso por task.updated. A tela mostra um bloco aninhado com a tarefa, o progresso e o resultado.\n */\nexport interface EventsItemSubagent {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemSubagent.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n /** Tipo de subagente. */\n agentType?: string | undefined;\n /** Descri\u00E7\u00E3o. */\n description?: string | undefined;\n /** o prompt dado ao subagente */\n task?: string | undefined;\n /** Modelo. */\n model?: string | undefined;\n /** Esfor\u00E7o de racioc\u00EDnio (low, medium, high\u2026). */\n effort?: string | undefined;\n /** Resultado. */\n result?: string | undefined;\n progress?: SmoothAgentApi.EventsTaskProgress | undefined;\n /** Id da thread nativa do subagente. */\n nativeThreadId?: string | undefined;\n /** Entrada da tool como texto (JSON parcial durante o stream). */\n inputText?: string | undefined;\n}\n\nexport namespace EventsItemSubagent {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `text`: a resposta em texto do agente; abre quando ele come\u00E7a a escrever e cresce por item.delta. A tela renderiza o texto (markdown) e substitui pelo final no item.completed.\n */\nexport interface EventsItemText {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemText.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n /** Texto. */\n text?: string | undefined;\n /** Codex final_answer \u00D7 commentary */\n phase?: EventsItemText.Phase | undefined;\n}\n\nexport namespace EventsItemText {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n /** Codex final_answer \u00D7 commentary */\n export const Phase = {\n Commentary: \"commentary\",\n Final: \"final\",\n } as const;\n export type Phase = (typeof Phase)[keyof typeof Phase];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `timer`: o agente agendou continuar depois (wakeAt, opcionalmente recorrente). A tela mostra \"volto \u00E0s HH:MM\"; o chat pode dormir at\u00E9 l\u00E1.\n */\nexport interface EventsItemTimer {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemTimer.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n wakeAt?: SmoothAgentApi.EventsTimestamp | undefined;\n /** Motivo. */\n reason?: string | undefined;\n /** O agendamento. */\n scheduleId?: string | undefined;\n /** Recorr\u00EAncia. */\n recurrence?: string | undefined;\n}\n\nexport namespace EventsItemTimer {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `tool_call`: o agente chamou uma ferramenta (MCP ou nativa); abre com a entrada (em stream enquanto o modelo monta) e fecha com a sa\u00EDda. A tela mostra nome, entrada e sa\u00EDda, com o status.\n */\nexport interface EventsItemToolCall {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemToolCall.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n /** Nome. */\n name?: string | undefined;\n /** servidor MCP */\n server?: string | undefined;\n /** vocabul\u00E1rio do ACP */\n toolKind?: EventsItemToolCall.ToolKind | undefined;\n /** Entrada (JSON). */\n input?: unknown | undefined;\n /** JSON parcial em stream */\n inputText?: string | undefined;\n output?: SmoothAgentApi.EventsToolOutput | undefined;\n /** Arquivos/linhas que a tool tocou. */\n locations?: EventsItemToolCall.Locations.Item[] | undefined;\n}\n\nexport namespace EventsItemToolCall {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n /** vocabul\u00E1rio do ACP */\n export const ToolKind = {\n Read: \"read\",\n Edit: \"edit\",\n Delete: \"delete\",\n Move: \"move\",\n Search: \"search\",\n Execute: \"execute\",\n Think: \"think\",\n Fetch: \"fetch\",\n Task: \"task\",\n Message: \"message\",\n Other: \"other\",\n } as const;\n export type ToolKind = (typeof ToolKind)[keyof typeof ToolKind];\n export type Locations = Locations.Item[];\n\n export namespace Locations {\n export interface Item {\n /** Caminho do arquivo. */\n path: string;\n /** Linha. */\n line?: number | undefined;\n }\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `user_message`: aparece quando o PROVEDOR leu uma mensagem do usu\u00E1rio (come\u00E7o do turno, steer ou prompt de subagente). A tela tira a mensagem da fila/inbox e a mostra como bal\u00E3o do usu\u00E1rio na timeline, pelo messageId.\n */\nexport interface EventsItemUserMessage {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemUserMessage.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n /** ausente s\u00F3 em subagent_prompt */\n messageId?: SmoothAgentApi.EventsMessageId | undefined;\n /** Id do lado do cliente (idempot\u00EAncia). */\n clientMessageId?: string | undefined;\n /** Conte\u00FAdo da mensagem. */\n content?: SmoothAgentApi.EventsContentPart[] | undefined;\n /** Como a mensagem entrou: turn_start, steer, steer_restart ou subagent_prompt. */\n via?: EventsItemUserMessage.Via | undefined;\n /** evid\u00EAncia do ponto de consumo */\n consumption?: EventsItemUserMessage.Consumption | undefined;\n}\n\nexport namespace EventsItemUserMessage {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n /** Como a mensagem entrou: turn_start, steer, steer_restart ou subagent_prompt. */\n export const Via = {\n TurnStart: \"turn_start\",\n Steer: \"steer\",\n SteerRestart: \"steer_restart\",\n SubagentPrompt: \"subagent_prompt\",\n } as const;\n export type Via = (typeof Via)[keyof typeof Via];\n /** evid\u00EAncia do ponto de consumo */\n export const Consumption = {\n Echo: \"echo\",\n Item: \"item\",\n Order: \"order\",\n Result: \"result\",\n } as const;\n export type Consumption = (typeof Consumption)[keyof typeof Consumption];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Item `web_search`: o agente buscou na web, abriu ou procurou numa p\u00E1gina. A tela mostra a busca/URL e os resultados.\n */\nexport interface EventsItemWebSearch {\n id: SmoothAgentApi.EventsItemId;\n /** Estado. */\n status: EventsItemWebSearch.Status;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n /** N\u00FAmero da tentativa (1 = a primeira). */\n attempt?: number | undefined;\n /** subagente = itens com parentItemId */\n parentItemId?: SmoothAgentApi.EventsItemId | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** trabalho que segue depois do turno: isento da regra do steer */\n background?: boolean | undefined;\n origin?: SmoothAgentApi.EventsOrigin | undefined;\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** este item substitui aquele (o provedor reescreveu; o outro vem item.retracted) */\n supersedes?: SmoothAgentApi.EventsItemId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n completedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n /** Consulta. */\n query?: string | undefined;\n /** Consultas. */\n queries?: string[] | undefined;\n /** search (busca), open (abriu p\u00E1gina) ou find (procurou na p\u00E1gina). */\n action?: EventsItemWebSearch.Action | undefined;\n /** URL. */\n url?: string | undefined;\n /** Resultados. */\n results?: EventsItemWebSearch.Results.Item[] | undefined;\n output?: SmoothAgentApi.EventsToolOutput | undefined;\n /** Entrada da tool como texto (JSON parcial durante o stream). */\n inputText?: string | undefined;\n}\n\nexport namespace EventsItemWebSearch {\n /** Estado. */\n export const Status = {\n InProgress: \"in_progress\",\n Waiting: \"waiting\",\n Completed: \"completed\",\n Failed: \"failed\",\n Interrupted: \"interrupted\",\n Declined: \"declined\",\n Cancelled: \"cancelled\",\n Retracted: \"retracted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n /** search (busca), open (abriu p\u00E1gina) ou find (procurou na p\u00E1gina). */\n export const Action = {\n Search: \"search\",\n Open: \"open\",\n Find: \"find\",\n } as const;\n export type Action = (typeof Action)[keyof typeof Action];\n export type Results = Results.Item[];\n\n export namespace Results {\n export interface Item {\n /** T\u00EDtulo curto pra tela. */\n title?: string | undefined;\n /** URL. */\n url?: string | undefined;\n /** Trecho. */\n snippet?: string | undefined;\n /** Dom\u00EDnio. */\n domain?: string | undefined;\n /** o texto cita isto */\n refId?: string | undefined;\n }\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Consumo da assinatura/chave \u2014 pronto pra tela\n */\nexport interface EventsLimits {\n provider: SmoothAgentApi.EventsProvider;\n /** De onde vem o limite: subscription, key ou agent. */\n via?: EventsLimits.Via | undefined;\n /** Plano da assinatura. */\n plan?: string | undefined;\n /** Janelas de limite. */\n windows: SmoothAgentApi.EventsLimitWindow[];\n /** Cr\u00E9ditos restantes. */\n credits?: EventsLimits.Credits | undefined;\n /** Uso al\u00E9m do plano. */\n overage?: EventsLimits.Overage | undefined;\n}\n\nexport namespace EventsLimits {\n /** De onde vem o limite: subscription, key ou agent. */\n export const Via = {\n Subscription: \"subscription\",\n Key: \"key\",\n Agent: \"agent\",\n } as const;\n export type Via = (typeof Via)[keyof typeof Via];\n\n /**\n * Cr\u00E9ditos restantes.\n */\n export interface Credits {\n /** Quanto resta. */\n remaining?: number | undefined;\n /** Unidade. */\n unit?: string | undefined;\n }\n\n /**\n * Uso al\u00E9m do plano.\n */\n export interface Overage {\n /** Estado. */\n status?: string | undefined;\n /** Em uso agora. */\n inUse?: boolean | undefined;\n /** Por que est\u00E1 desligado. */\n disabledReason?: string | undefined;\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Uma janela de limite da assinatura/chave (5 h, 7 dias, prim\u00E1ria\u2026).\n */\nexport interface EventsLimitWindow {\n /** five_hour, seven_day, primary, secondary\u2026 */\n id: string;\n /** R\u00F3tulo. */\n label?: string | undefined;\n /** Tamanho da janela em minutos. */\n durationMins?: number | undefined;\n /** Quanto da janela foi usado (0\u2013100). */\n usedPercent?: number | undefined;\n resetsAt?: SmoothAgentApi.EventsTimestamp | undefined;\n /** ok, warning (perto do limite) ou reached (estourou). */\n status: EventsLimitWindow.Status;\n}\n\nexport namespace EventsLimitWindow {\n /** ok, warning (perto do limite) ou reached (estourou). */\n export const Status = {\n Ok: \"ok\",\n Warning: \"warning\",\n Reached: \"reached\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\n/**\n * QUEM causou\n */\nexport interface EventsOrigin {\n /** user = uma interface; agent = o agente (prompt de subagente); provider = o provedor sozinho (wake, peer); schedule = agendamento; system = a plataforma */\n kind: EventsOrigin.Kind;\n /** Id do usu\u00E1rio. */\n userId?: string | undefined;\n /** a interface/aba */\n clientId?: string | undefined;\n /** o token de dispositivo */\n deviceId?: string | undefined;\n /** nome do usu\u00E1rio pra tela (users.displayName, definido pelo dev) */\n displayName?: string | undefined;\n /** r\u00F3tulo do dispositivo da sess\u00E3o (web, celular, runner local\u2026) */\n deviceName?: string | undefined;\n /** nome leg\u00EDvel (peer, agendamento) */\n name?: string | undefined;\n /** kind=schedule: o agendamento que disparou (schedule_task) */\n scheduleId?: string | undefined;\n}\n\nexport namespace EventsOrigin {\n /** user = uma interface; agent = o agente (prompt de subagente); provider = o provedor sozinho (wake, peer); schedule = agendamento; system = a plataforma */\n export const Kind = {\n User: \"user\",\n Agent: \"agent\",\n Provider: \"provider\",\n Schedule: \"schedule\",\n System: \"system\",\n } as const;\n export type Kind = (typeof Kind)[keyof typeof Kind];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Um frame nativo do provedor, como chegou ou saiu (s\u00F3 com includeRaw).\n */\nexport interface EventsRawFrame {\n provider: SmoothAgentApi.EventsProvider;\n /** in = do provedor; out = pro provedor. */\n direction?: EventsRawFrame.Direction | undefined;\n frame?: unknown | undefined;\n}\n\nexport namespace EventsRawFrame {\n /** in = do provedor; out = pro provedor. */\n export const Direction = {\n In: \"in\",\n Out: \"out\",\n } as const;\n export type Direction = (typeof Direction)[keyof typeof Direction];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * QUEM rodou este run \u2014 o que o control projeta (runs, uso por provedor)\n */\nexport interface EventsRunAgent {\n agentId: SmoothAgentApi.EventsAgentId;\n /** revis\u00E3o da config do agente que rodou */\n agentRevision: number;\n /** Nome do agente pra tela. */\n agentName?: string | undefined;\n provider: SmoothAgentApi.EventsProvider;\n /** Modelo. */\n model?: string | undefined;\n /** Esfor\u00E7o de racioc\u00EDnio (low, medium, high\u2026). */\n effort?: string | undefined;\n /** que credencial rodou (sem segredo): a do agente (inclui o provedor fake), a assinatura do usu\u00E1rio ou a chave de API \u2014 os mesmos valores do runs/config e do /selection */\n credentialVia: EventsRunAgent.CredentialVia;\n}\n\nexport namespace EventsRunAgent {\n /** que credencial rodou (sem segredo): a do agente (inclui o provedor fake), a assinatura do usu\u00E1rio ou a chave de API \u2014 os mesmos valores do runs/config e do /selection */\n export const CredentialVia = {\n Agent: \"agent\",\n Subscription: \"subscription\",\n Key: \"key\",\n } as const;\n export type CredentialVia = (typeof CredentialVia)[keyof typeof CredentialVia];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Por que o run abriu e o que o disparou.\n */\nexport interface EventsRunTrigger {\n /** por que o run abriu: mensagem, wake (tarefa acabou), agendamento, troca, peer, provedor sem dizer, plataforma */\n kind: EventsRunTrigger.Kind;\n /** Mensagens envolvidas. */\n messageIds?: SmoothAgentApi.EventsMessageId[] | undefined;\n taskId?: SmoothAgentApi.EventsTaskId | undefined;\n /** O agendamento. */\n scheduleId?: string | undefined;\n switchId?: SmoothAgentApi.EventsSwitchId | undefined;\n /** Nome. */\n name?: string | undefined;\n}\n\nexport namespace EventsRunTrigger {\n /** por que o run abriu: mensagem, wake (tarefa acabou), agendamento, troca, peer, provedor sem dizer, plataforma */\n export const Kind = {\n Message: \"message\",\n Wake: \"wake\",\n Schedule: \"schedule\",\n Handoff: \"handoff\",\n Peer: \"peer\",\n Provider: \"provider\",\n System: \"system\",\n } as const;\n export type Kind = (typeof Kind)[keyof typeof Kind];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Trabalho que vive al\u00E9m do item (subagente, background, monitor)\n */\nexport interface EventsTask {\n taskId: SmoothAgentApi.EventsTaskId;\n /** Tipo de tarefa: subagent, command (background), monitor ou other. */\n kind: EventsTask.Kind;\n /** Estado da tarefa: running, completed, failed ou stopped. */\n status: EventsTask.Status;\n /** Descri\u00E7\u00E3o. */\n description?: string | undefined;\n /** o agente espera: SEGURA o run; n\u00E3o-awaited segura s\u00F3 a box */\n awaited: boolean;\n itemId?: SmoothAgentApi.EventsItemId | undefined;\n runId?: SmoothAgentApi.EventsRunId | undefined;\n startedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n endedAt?: SmoothAgentApi.EventsTimestamp | undefined;\n /** Resumo. */\n summary?: string | undefined;\n /** C\u00F3digo de sa\u00EDda. */\n exitCode?: number | undefined;\n /** Tem sa\u00EDda guardada pra ler. */\n hasOutput?: boolean | undefined;\n progress?: SmoothAgentApi.EventsTaskProgress | undefined;\n native?: SmoothAgentApi.EventsNativeRef | undefined;\n}\n\nexport namespace EventsTask {\n /** Tipo de tarefa: subagent, command (background), monitor ou other. */\n export const Kind = {\n Subagent: \"subagent\",\n Command: \"command\",\n Monitor: \"monitor\",\n Other: \"other\",\n } as const;\n export type Kind = (typeof Kind)[keyof typeof Kind];\n /** Estado da tarefa: running, completed, failed ou stopped. */\n export const Status = {\n Running: \"running\",\n Completed: \"completed\",\n Failed: \"failed\",\n Stopped: \"stopped\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport interface FileObject {\n id: string;\n workspaceId: string;\n userId: string | null;\n filename: string;\n mimeType: string;\n sizeBytes: number;\n status: FileObject.Status;\n createdAt: SmoothAgentApi.Timestamp;\n}\n\nexport namespace FileObject {\n export const Status = {\n Uploading: \"uploading\",\n Ready: \"ready\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport interface LoginStatus {\n loginId: string;\n status: LoginStatus.Status;\n error?: SmoothAgentApi.ErrorBody | undefined;\n}\n\nexport namespace LoginStatus {\n export const Status = {\n Pending: \"pending\",\n Completed: \"completed\",\n Failed: \"failed\",\n Expired: \"expired\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport interface Machine {\n id: string;\n workspaceId: string;\n userId: string;\n kind: Machine.Kind;\n /** Nome do dev (cloud_box) ou do computador (local). \u00DAnico por (workspace, usu\u00E1rio). */\n name: string;\n /** S\u00F3 nuvem. O perfil da m\u00E1quina vale pra todo chat que aponta pra ela. */\n profile?: SmoothAgentApi.BoxProfile | undefined;\n state: Machine.State;\n /** S\u00F3 local: o que o runner reportou ao parear. */\n device?: Machine.Device | undefined;\n lastSeenAt: SmoothAgentApi.Timestamp | null;\n createdAt: SmoothAgentApi.Timestamp;\n}\n\nexport namespace Machine {\n export const Kind = {\n CloudChat: \"cloud_chat\",\n CloudBox: \"cloud_box\",\n Local: \"local\",\n } as const;\n export type Kind = (typeof Kind)[keyof typeof Kind];\n export const State = {\n Online: \"online\",\n Offline: \"offline\",\n Busy: \"busy\",\n Waking: \"waking\",\n Ready: \"ready\",\n Sleeping: \"sleeping\",\n Crashed: \"crashed\",\n } as const;\n export type State = (typeof State)[keyof typeof State];\n\n /**\n * S\u00F3 local: o que o runner reportou ao parear.\n */\n export interface Device {\n os: string;\n arch: string;\n runnerVersion: string;\n hostname?: string | undefined;\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Um provedor na lista do usu\u00E1rio: o status + se algum agente que ele pode usar roda nele.\n */\nexport interface MyProviderStatus {\n provider: SmoothAgentApi.ProviderKind;\n connected: boolean;\n /** `agent` = o agente j\u00E1 traz (o usu\u00E1rio n\u00E3o precisa conectar). */\n via: MyProviderStatus.Via.Item[];\n /** S\u00F3 assinatura: quando o access token atual vence (o CLI renova sozinho \u2014 doutrina do token). */\n expiresAt?: (SmoothAgentApi.Timestamp | null) | undefined;\n /**\n * Sa\u00FAde pro dashboard. `ok`; `expiring` = o access token da assinatura venceu, a box renova sozinha no\n * pr\u00F3ximo uso (nada a fazer); `dead` = o provedor recusou a renova\u00E7\u00E3o e n\u00E3o h\u00E1 outra viva (reconectar);\n * `disconnected` = nada conectado.\n */\n status: MyProviderStatus.Status;\n /** Explica\u00E7\u00E3o curta pro usu\u00E1rio quando n\u00E3o \u00E9 `ok`. */\n message?: string | undefined;\n /** Os modelos que ESTA credencial libera (extra\u00EDdos do provedor, nunca cat\u00E1logo nosso). */\n models: SmoothAgentApi.ModelInfo[];\n /** Como conectar o que falta. */\n connect: MyProviderStatus.Connect.Item[];\n /**\n * `true` = algum agente que o usu\u00E1rio pode usar roda neste provedor (o app do cliente filtra por isso pra\n * mostrar \"s\u00F3 o configurado\"); `false` = oferecido, mas nenhum agente dele precisa agora.\n */\n needed: boolean;\n}\n\nexport namespace MyProviderStatus {\n export type Via = Via.Item[];\n\n export namespace Via {\n export const Item = {\n Subscription: \"subscription\",\n Key: \"key\",\n Agent: \"agent\",\n } as const;\n export type Item = (typeof Item)[keyof typeof Item];\n }\n\n /**\n * Sa\u00FAde pro dashboard. `ok`; `expiring` = o access token da assinatura venceu, a box renova sozinha no\n * pr\u00F3ximo uso (nada a fazer); `dead` = o provedor recusou a renova\u00E7\u00E3o e n\u00E3o h\u00E1 outra viva (reconectar);\n * `disconnected` = nada conectado.\n */\n export const Status = {\n Ok: \"ok\",\n Expiring: \"expiring\",\n Dead: \"dead\",\n Disconnected: \"disconnected\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n export type Connect = Connect.Item[];\n\n export namespace Connect {\n export const Item = {\n Oauth: \"oauth\",\n Device: \"device\",\n Key: \"key\",\n } as const;\n export type Item = (typeof Item)[keyof typeof Item];\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport interface Pairing {\n /** C\u00F3digo curto pra digitar (`XXXX-XXXX`, estilo device flow RFC 8628). */\n code: string;\n /** Comando pronto: `npx smoothagent connect --code XXXX-XXXX`. */\n command: string;\n expiresAt: SmoothAgentApi.Timestamp;\n status: Pairing.Status;\n machineId?: string | undefined;\n}\n\nexport namespace Pairing {\n export const Status = {\n Pending: \"pending\",\n Completed: \"completed\",\n Expired: \"expired\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\n/**\n * Onde os chats deste agente rodam por padr\u00E3o (`chats.create({ machineId })` sobrescreve):\n * - `chat`: box pr\u00F3pria por chat (padr\u00E3o);\n * - `user`: uma box por usu\u00E1rio, todos os chats dele nela;\n * - `machine`: uma m\u00E1quina fixa (box com nome ou computador pareado) \u2014 `machineId`.\n */\nexport interface Placement {\n mode: Placement.Mode;\n /**\n * S\u00F3 com `machine`: as m\u00E1quinas (do usu\u00E1rio) em que o agente pode rodar. Ausente = qualquer uma.\n * A m\u00E1quina do chat \u00E9 escolhida no `chats.create` (`machineId`, obrigat\u00F3rio com `machine`).\n */\n machineIds?: string[] | undefined;\n /**\n * Computador pareado offline: `reject` (`machine_offline`) ou `cloud` (cai numa box do chat). `cloud`\n * vale S\u00D3 ao criar o chat; mensagem num chat que j\u00E1 est\u00E1 no computador desligado \u00E9 sempre\n * `machine_offline` (mover o chat de box com hist\u00F3rico + sess\u00E3o \u00E9 a fase \"troca de m\u00E1quina\").\n */\n whenOffline?: Placement.WhenOffline | undefined;\n}\n\nexport namespace Placement {\n export const Mode = {\n Chat: \"chat\",\n User: \"user\",\n Machine: \"machine\",\n } as const;\n export type Mode = (typeof Mode)[keyof typeof Mode];\n /**\n * Computador pareado offline: `reject` (`machine_offline`) ou `cloud` (cai numa box do chat). `cloud`\n * vale S\u00D3 ao criar o chat; mensagem num chat que j\u00E1 est\u00E1 no computador desligado \u00E9 sempre\n * `machine_offline` (mover o chat de box com hist\u00F3rico + sess\u00E3o \u00E9 a fase \"troca de m\u00E1quina\").\n */\n export const WhenOffline = {\n Reject: \"reject\",\n Cloud: \"cloud\",\n } as const;\n export type WhenOffline = (typeof WhenOffline)[keyof typeof WhenOffline];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nexport interface PreTurnHook {\n /** Chamado do NOSSO servidor (nunca da box nem do runner local) antes de cada turno. */\n url: string;\n /**\n * Configura\u00E7\u00E3o sigilosa de quem integra (chaves da revenda, ids de template\u2026): vai nos headers\n * da chamada, guardada cifrada, write-only. Aceita `{{secret:NOME}}`.\n */\n headers?: Record<string, string> | undefined;\n /** Padr\u00E3o 800 ms. */\n timeoutMs?: number | undefined;\n /** `open` (padr\u00E3o): falhou/estourou \u2192 turno segue sem o hook. `closed`: turno falha. */\n onFailure?: PreTurnHook.OnFailure | undefined;\n}\n\nexport namespace PreTurnHook {\n /** `open` (padr\u00E3o): falhou/estourou \u2192 turno segue sem o hook. `closed`: turno falha. */\n export const OnFailure = {\n Open: \"open\",\n Closed: \"closed\",\n } as const;\n export type OnFailure = (typeof OnFailure)[keyof typeof OnFailure];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport interface Principal {\n kind: Principal.Kind;\n accountId: string;\n workspaceId: string | null;\n /** S\u00F3 `kind: user` (ou chave com `SmoothAgent-As-User`). */\n userId?: string | undefined;\n /** Sess\u00E3o do dispositivo (token de usu\u00E1rio). */\n sessionId?: string | undefined;\n /** Escopos efetivos (chave restrita) \u2014 `[\"*\"]` pras chaves cheias. */\n scopes: SmoothAgentApi.Scope[];\n /** `null` = todos os agentes do workspace. */\n agents: string[] | null;\n /** Chave que est\u00E1 agindo como o usu\u00E1rio (`sa.as`). */\n actingKeyId?: string | undefined;\n /**\n * O Assistente da plataforma agindo NA CONTA do usu\u00E1rio que conversa (token de ferramenta +\n * `SmoothAgent-Delegate: account`). Escopo enxuto e sem nada destrutivo.\n */\n delegated?: boolean | undefined;\n}\n\nexport namespace Principal {\n export const Kind = {\n AccountKey: \"account_key\",\n WorkspaceKey: \"workspace_key\",\n RestrictedKey: \"restricted_key\",\n User: \"user\",\n } as const;\n export type Kind = (typeof Kind)[keyof typeof Kind];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport interface ProviderLimits {\n provider: SmoothAgentApi.EventsProvider;\n /** De onde vem o limite: subscription, key ou agent. */\n via?: ProviderLimits.Via | undefined;\n /** Plano da assinatura. */\n plan?: string | undefined;\n /** Janelas de limite. */\n windows: SmoothAgentApi.EventsLimitWindow[];\n /** Cr\u00E9ditos restantes. */\n credits?: ProviderLimits.Credits | undefined;\n /** Uso al\u00E9m do plano. */\n overage?: ProviderLimits.Overage | undefined;\n updatedAt: SmoothAgentApi.Timestamp | null;\n}\n\nexport namespace ProviderLimits {\n /** De onde vem o limite: subscription, key ou agent. */\n export const Via = {\n Subscription: \"subscription\",\n Key: \"key\",\n Agent: \"agent\",\n } as const;\n export type Via = (typeof Via)[keyof typeof Via];\n\n /**\n * Cr\u00E9ditos restantes.\n */\n export interface Credits {\n /** Quanto resta. */\n remaining?: number | undefined;\n /** Unidade. */\n unit?: string | undefined;\n }\n\n /**\n * Uso al\u00E9m do plano.\n */\n export interface Overage {\n /** Estado. */\n status?: string | undefined;\n /** Em uso agora. */\n inUse?: boolean | undefined;\n /** Por que est\u00E1 desligado. */\n disabledReason?: string | undefined;\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\nexport interface ProviderStatus {\n provider: SmoothAgentApi.ProviderKind;\n connected: boolean;\n /** `agent` = o agente j\u00E1 traz (o usu\u00E1rio n\u00E3o precisa conectar). */\n via: ProviderStatus.Via.Item[];\n /** S\u00F3 assinatura: quando o access token atual vence (o CLI renova sozinho \u2014 doutrina do token). */\n expiresAt?: (SmoothAgentApi.Timestamp | null) | undefined;\n /**\n * Sa\u00FAde pro dashboard. `ok`; `expiring` = o access token da assinatura venceu, a box renova sozinha no\n * pr\u00F3ximo uso (nada a fazer); `dead` = o provedor recusou a renova\u00E7\u00E3o e n\u00E3o h\u00E1 outra viva (reconectar);\n * `disconnected` = nada conectado.\n */\n status: ProviderStatus.Status;\n /** Explica\u00E7\u00E3o curta pro usu\u00E1rio quando n\u00E3o \u00E9 `ok`. */\n message?: string | undefined;\n /** Os modelos que ESTA credencial libera (extra\u00EDdos do provedor, nunca cat\u00E1logo nosso). */\n models: SmoothAgentApi.ModelInfo[];\n /** Como conectar o que falta. */\n connect: ProviderStatus.Connect.Item[];\n}\n\nexport namespace ProviderStatus {\n export type Via = Via.Item[];\n\n export namespace Via {\n export const Item = {\n Subscription: \"subscription\",\n Key: \"key\",\n Agent: \"agent\",\n } as const;\n export type Item = (typeof Item)[keyof typeof Item];\n }\n\n /**\n * Sa\u00FAde pro dashboard. `ok`; `expiring` = o access token da assinatura venceu, a box renova sozinha no\n * pr\u00F3ximo uso (nada a fazer); `dead` = o provedor recusou a renova\u00E7\u00E3o e n\u00E3o h\u00E1 outra viva (reconectar);\n * `disconnected` = nada conectado.\n */\n export const Status = {\n Ok: \"ok\",\n Expiring: \"expiring\",\n Dead: \"dead\",\n Disconnected: \"disconnected\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n export type Connect = Connect.Item[];\n\n export namespace Connect {\n export const Item = {\n Oauth: \"oauth\",\n Device: \"device\",\n Key: \"key\",\n } as const;\n export type Item = (typeof Item)[keyof typeof Item];\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * Um run, com quem rodou (cada run registra agente/provedor/modelo).\n */\nexport interface RunSummary {\n id: string;\n agentId: string;\n agentRevision: number;\n provider: SmoothAgentApi.EventsProvider;\n model: string | null;\n credentialVia: string | null;\n status: RunSummary.Status;\n errorCode?: string | undefined;\n attempts: number;\n usage: SmoothAgentApi.EventsUsage | null;\n /** Primeiro e \u00FAltimo evento do run no log (pra pular pro run no hist\u00F3rico). */\n firstEventId: string;\n lastEventId: string | null;\n startedAt: SmoothAgentApi.Timestamp;\n completedAt: SmoothAgentApi.Timestamp | null;\n}\n\nexport namespace RunSummary {\n export const Status = {\n Running: \"running\",\n Completed: \"completed\",\n Stopped: \"stopped\",\n Failed: \"failed\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * A troca \u00E9 um comando da fila: `accepted` = o dono da fila aceitou (ms). A box aplica antes do\n * pr\u00F3ximo run (na hora, se o chat est\u00E1 parado) e a tela acompanha pelo `agent.switched` numerado; com run\n * ativo ela aparece como `scheduledSwitch`. Trocar de novo SUBSTITUI a pendente. Idempotente pelo\n * `Idempotency-Key` (vira o `switchId`).\n */\nexport interface SwitchResult {\n status: SwitchResult.Status;\n /** A vers\u00E3o da fila depois da troca (a mesma do estado da fila no snapshot). */\n version: number;\n chat: SmoothAgentApi.Chat;\n}\n\nexport namespace SwitchResult {\n export const Status = {\n Accepted: \"accepted\",\n } as const;\n export type Status = (typeof Status)[keyof typeof Status];\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as SmoothAgentApi from \"../index.js\";\n\n/**\n * `GET /me` com o token de FERRAMENTA do chat (o MCP `smoothagent` do ops): s\u00F3 leitura dos chats daquele\n * usu\u00E1rio naquele agente + as tools que a config liberou.\n */\nexport interface ToolPrincipal {\n kind: ToolPrincipal.Kind;\n workspaceId: string;\n userId: string;\n chatId: string;\n agentId: string;\n tools: ToolPrincipal.Tools.Item[];\n scopes: SmoothAgentApi.Scope[];\n}\n\nexport namespace ToolPrincipal {\n export const Kind = {\n Tool: \"tool\",\n } as const;\n export type Kind = (typeof Kind)[keyof typeof Kind];\n export type Tools = Tools.Item[];\n\n export namespace Tools {\n export const Item = {\n Memory: \"memory\",\n Schedule: \"schedule\",\n Platform: \"platform\",\n } as const;\n export type Item = (typeof Item)[keyof typeof Item];\n }\n}\n", "import type { EndpointMetadata } from \"../fetcher/EndpointMetadata.js\";\nimport type { AuthRequest } from \"./AuthRequest.js\";\n\nexport interface AuthProvider {\n getAuthRequest(arg?: { endpointMetadata?: EndpointMetadata }): Promise<AuthRequest>;\n}\n\nexport function isAuthProvider(value: unknown): value is AuthProvider {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"getAuthRequest\" in value &&\n typeof value.getAuthRequest === \"function\"\n );\n}\n", "import type { AuthProvider } from \"./AuthProvider.js\";\nimport type { AuthRequest } from \"./AuthRequest.js\";\n\nexport class NoOpAuthProvider implements AuthProvider {\n public getAuthRequest(): Promise<AuthRequest> {\n return Promise.resolve({ headers: {} });\n }\n}\n", "import type { EndpointMetadata } from \"./EndpointMetadata.js\";\nimport type { Supplier } from \"./Supplier.js\";\n\ntype EndpointSupplierFn<T> = (arg: { endpointMetadata?: EndpointMetadata }) => T | Promise<T>;\nexport type EndpointSupplier<T> = Supplier<T> | EndpointSupplierFn<T>;\nexport const EndpointSupplier = {\n get: async <T>(supplier: EndpointSupplier<T>, arg: { endpointMetadata?: EndpointMetadata }): Promise<T> => {\n if (typeof supplier === \"function\") {\n return (supplier as EndpointSupplierFn<T>)(arg);\n } else {\n return supplier;\n }\n },\n};\n", "export const LogLevel = {\n Debug: \"debug\",\n Info: \"info\",\n Warn: \"warn\",\n Error: \"error\",\n} as const;\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\nconst logLevelMap: Record<LogLevel, number> = {\n [LogLevel.Debug]: 1,\n [LogLevel.Info]: 2,\n [LogLevel.Warn]: 3,\n [LogLevel.Error]: 4,\n};\n\nexport interface ILogger {\n /**\n * Logs a debug message.\n * @param message - The message to log\n * @param args - Additional arguments to log\n */\n debug(message: string, ...args: unknown[]): void;\n /**\n * Logs an info message.\n * @param message - The message to log\n * @param args - Additional arguments to log\n */\n info(message: string, ...args: unknown[]): void;\n /**\n * Logs a warning message.\n * @param message - The message to log\n * @param args - Additional arguments to log\n */\n warn(message: string, ...args: unknown[]): void;\n /**\n * Logs an error message.\n * @param message - The message to log\n * @param args - Additional arguments to log\n */\n error(message: string, ...args: unknown[]): void;\n}\n\n/**\n * Configuration for logger initialization.\n */\nexport interface LogConfig {\n /**\n * Minimum log level to output.\n * @default LogLevel.Info\n */\n level?: LogLevel;\n /**\n * Logger implementation to use.\n * @default new ConsoleLogger()\n */\n logger?: ILogger;\n /**\n * Whether logging should be silenced.\n * @default true\n */\n silent?: boolean;\n}\n\n/**\n * Default console-based logger implementation.\n */\nexport class ConsoleLogger implements ILogger {\n debug(message: string, ...args: unknown[]): void {\n console.debug(message, ...args);\n }\n info(message: string, ...args: unknown[]): void {\n console.info(message, ...args);\n }\n warn(message: string, ...args: unknown[]): void {\n console.warn(message, ...args);\n }\n error(message: string, ...args: unknown[]): void {\n console.error(message, ...args);\n }\n}\n\n/**\n * Logger class that provides level-based logging functionality.\n */\nexport class Logger {\n private readonly level: number;\n private readonly logger: ILogger;\n private readonly silent: boolean;\n\n /**\n * Creates a new logger instance.\n * @param config - Logger configuration\n */\n constructor(config: Required<LogConfig>) {\n this.level = logLevelMap[config.level];\n this.logger = config.logger;\n this.silent = config.silent;\n }\n\n /**\n * Checks if a log level should be output based on configuration.\n * @param level - The log level to check\n * @returns True if the level should be logged\n */\n public shouldLog(level: LogLevel): boolean {\n return !this.silent && this.level <= logLevelMap[level];\n }\n\n /**\n * Checks if debug logging is enabled.\n * @returns True if debug logs should be output\n */\n public isDebug(): boolean {\n return this.shouldLog(LogLevel.Debug);\n }\n\n /**\n * Logs a debug message if debug logging is enabled.\n * @param message - The message to log\n * @param args - Additional arguments to log\n */\n public debug(message: string, ...args: unknown[]): void {\n if (this.isDebug()) {\n this.logger.debug(message, ...args);\n }\n }\n\n /**\n * Checks if info logging is enabled.\n * @returns True if info logs should be output\n */\n public isInfo(): boolean {\n return this.shouldLog(LogLevel.Info);\n }\n\n /**\n * Logs an info message if info logging is enabled.\n * @param message - The message to log\n * @param args - Additional arguments to log\n */\n public info(message: string, ...args: unknown[]): void {\n if (this.isInfo()) {\n this.logger.info(message, ...args);\n }\n }\n\n /**\n * Checks if warning logging is enabled.\n * @returns True if warning logs should be output\n */\n public isWarn(): boolean {\n return this.shouldLog(LogLevel.Warn);\n }\n\n /**\n * Logs a warning message if warning logging is enabled.\n * @param message - The message to log\n * @param args - Additional arguments to log\n */\n public warn(message: string, ...args: unknown[]): void {\n if (this.isWarn()) {\n this.logger.warn(message, ...args);\n }\n }\n\n /**\n * Checks if error logging is enabled.\n * @returns True if error logs should be output\n */\n public isError(): boolean {\n return this.shouldLog(LogLevel.Error);\n }\n\n /**\n * Logs an error message if error logging is enabled.\n * @param message - The message to log\n * @param args - Additional arguments to log\n */\n public error(message: string, ...args: unknown[]): void {\n if (this.isError()) {\n this.logger.error(message, ...args);\n }\n }\n}\n\nexport function createLogger(config?: LogConfig | Logger): Logger {\n if (config == null) {\n return defaultLogger;\n }\n if (config instanceof Logger) {\n return config;\n }\n config = config ?? {};\n config.level ??= LogLevel.Info;\n config.logger ??= new ConsoleLogger();\n config.silent ??= true;\n return new Logger(config as Required<LogConfig>);\n}\n\nconst defaultLogger: Logger = new Logger({\n level: LogLevel.Info,\n logger: new ConsoleLogger(),\n silent: true,\n});\n", "type ArrayFormat = \"indices\" | \"repeat\" | \"comma\";\n\ninterface QueryStringOptions {\n arrayFormat?: ArrayFormat;\n encode?: boolean;\n}\n\nconst defaultQsOptions: Required<QueryStringOptions> = {\n arrayFormat: \"indices\",\n encode: true,\n} as const;\n\nfunction encodeValue(value: unknown, shouldEncode: boolean): string {\n if (value === undefined) {\n return \"\";\n }\n if (value === null) {\n return \"\";\n }\n const stringValue = String(value);\n return shouldEncode ? encodeURIComponent(stringValue) : stringValue;\n}\n\nfunction stringifyObject(obj: Record<string, unknown>, prefix = \"\", options: Required<QueryStringOptions>): string[] {\n const parts: string[] = [];\n\n for (const [key, value] of Object.entries(obj)) {\n const fullKey = prefix ? `${prefix}[${key}]` : key;\n\n if (value == null) {\n continue;\n }\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n continue;\n }\n const effectiveFormat = options.arrayFormat;\n if (effectiveFormat === \"comma\") {\n const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey;\n const encodedValues = value\n .filter((item) => item !== undefined && item !== null)\n .map((item) => encodeValue(item, options.encode));\n if (encodedValues.length > 0) {\n parts.push(`${encodedKey}=${encodedValues.join(\",\")}`);\n }\n } else {\n for (let i = 0; i < value.length; i++) {\n const item = value[i];\n if (item == null) {\n continue;\n }\n if (typeof item === \"object\" && !Array.isArray(item) && item !== null) {\n const arrayKey = effectiveFormat === \"indices\" ? `${fullKey}[${i}]` : fullKey;\n parts.push(...stringifyObject(item as Record<string, unknown>, arrayKey, options));\n } else {\n const arrayKey = effectiveFormat === \"indices\" ? `${fullKey}[${i}]` : fullKey;\n const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey;\n parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`);\n }\n }\n }\n } else if (typeof value === \"object\" && value !== null) {\n if (Object.keys(value as Record<string, unknown>).length === 0) {\n continue;\n }\n parts.push(...stringifyObject(value as Record<string, unknown>, fullKey, options));\n } else {\n const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey;\n parts.push(`${encodedKey}=${encodeValue(value, options.encode)}`);\n }\n }\n\n return parts;\n}\n\nexport function toQueryString(obj: unknown, options?: QueryStringOptions): string {\n if (obj == null || typeof obj !== \"object\") {\n return \"\";\n }\n\n const parts = stringifyObject(obj as Record<string, unknown>, \"\", {\n ...defaultQsOptions,\n ...options,\n });\n return parts.join(\"&\");\n}\n", "import { toQueryString } from \"../url/qs.js\";\n\nexport function createRequestUrl(baseUrl: string, queryParameters?: Record<string, unknown>): string {\n const queryString = toQueryString(queryParameters, { arrayFormat: \"repeat\" });\n return queryString ? `${baseUrl}?${queryString}` : baseUrl;\n}\n", "export type BinaryResponse = {\n /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */\n bodyUsed: Response[\"bodyUsed\"];\n /**\n * Returns a ReadableStream of the response body.\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body)\n */\n stream: () => Response[\"body\"];\n /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */\n arrayBuffer: () => ReturnType<Response[\"arrayBuffer\"]>;\n /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */\n blob: () => ReturnType<Response[\"blob\"]>;\n /**\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes)\n * Some versions of the Fetch API may not support this method.\n */\n bytes?(): Promise<Uint8Array>;\n};\n\nexport function getBinaryResponse(response: Response): BinaryResponse {\n const binaryResponse: BinaryResponse = {\n get bodyUsed() {\n return response.bodyUsed;\n },\n stream: () => response.body,\n arrayBuffer: response.arrayBuffer.bind(response),\n blob: response.blob.bind(response),\n };\n if (\"bytes\" in response && typeof response.bytes === \"function\") {\n binaryResponse.bytes = response.bytes.bind(response);\n }\n\n return binaryResponse;\n}\n", "import { fromJson } from \"../json.js\";\nimport { getBinaryResponse } from \"./BinaryResponse.js\";\n\n// Pins the upstream Response so undici's FinalizationRegistry can't GC it and cancel the body stream.\nfunction retainResponse(target: object, response: Response): void {\n Object.defineProperty(target, \"__fern_response_ref\", {\n value: response,\n enumerable: false,\n configurable: true,\n writable: false,\n });\n}\n\nexport type ResponseBodyError = {\n ok: false;\n error: { reason: \"non-json\"; statusCode: number; rawBody: string } | { reason: \"body-is-null\"; statusCode: number };\n};\n\nconst responseBodyErrors = new WeakSet<object>();\n\nfunction responseBodyError(error: ResponseBodyError[\"error\"]): ResponseBodyError {\n const record: ResponseBodyError = { ok: false, error };\n responseBodyErrors.add(record);\n return record;\n}\n\n/**\n * Returns true when `value` is a failure record created by `getResponseBody` (for example malformed JSON),\n * as opposed to a parsed JSON body that happens to have the same shape.\n */\nexport function isResponseBodyError(value: unknown): value is ResponseBodyError {\n return typeof value === \"object\" && value != null && responseBodyErrors.has(value);\n}\n\nexport async function getResponseBody(response: Response, responseType?: string): Promise<unknown> {\n switch (responseType) {\n case \"binary-response\":\n return getBinaryResponse(response);\n case \"blob\":\n return await response.blob();\n case \"arrayBuffer\":\n return await response.arrayBuffer();\n case \"sse\":\n if (response.body == null) {\n return responseBodyError({\n reason: \"body-is-null\",\n statusCode: response.status,\n });\n }\n retainResponse(response.body, response);\n return response.body;\n case \"streaming\":\n if (response.body == null) {\n return responseBodyError({\n reason: \"body-is-null\",\n statusCode: response.status,\n });\n }\n\n retainResponse(response.body, response);\n return response.body;\n\n case \"text\":\n return await response.text();\n }\n\n // if responseType is \"json\" or not specified, try to parse as JSON\n const text = await response.text();\n if (text.length > 0) {\n try {\n const responseBody = fromJson(text);\n return responseBody;\n } catch (_err) {\n return responseBodyError({\n reason: \"non-json\",\n statusCode: response.status,\n rawBody: text,\n });\n }\n }\n return undefined;\n}\n", "import { fromJson } from \"../json.js\";\nimport { getResponseBody, isResponseBodyError } from \"./getResponseBody.js\";\n\n/** Parses a JSON error body, falling back to the raw text so the status and body are never lost. */\nfunction parseJsonErrorBody(text: string): unknown {\n if (text.length === 0) {\n return undefined;\n }\n try {\n return fromJson(text);\n } catch {\n return text;\n }\n}\n\nexport async function getErrorResponseBody(response: Response): Promise<unknown> {\n let contentType = response.headers.get(\"Content-Type\")?.toLowerCase();\n if (contentType == null || contentType.length === 0) {\n const body = await getResponseBody(response);\n if (isResponseBodyError(body)) {\n return body.error.reason === \"non-json\" ? body.error.rawBody : undefined;\n }\n return body;\n }\n\n if (contentType.indexOf(\";\") !== -1) {\n contentType = contentType.split(\";\")[0]?.trim() ?? \"\";\n }\n switch (contentType) {\n case \"application/hal+json\":\n case \"application/json\":\n case \"application/ld+json\":\n case \"application/problem+json\":\n case \"application/vnd.api+json\":\n case \"text/json\":\n return parseJsonErrorBody(await response.text());\n default:\n if (contentType.startsWith(\"application/vnd.\") && contentType.endsWith(\"+json\")) {\n return parseJsonErrorBody(await response.text());\n }\n\n // Fallback to plain text if content type is not recognized\n // Even if no body is present, the response will be an empty string\n return await response.text();\n }\n}\n", "export async function getFetchFn(): Promise<typeof fetch> {\n return fetch;\n}\n", "import { toJson } from \"../json.js\";\nimport { toQueryString } from \"../url/qs.js\";\n\nexport declare namespace GetRequestBody {\n interface Args {\n body: unknown;\n type: \"json\" | \"file\" | \"bytes\" | \"form\" | \"other\";\n }\n}\n\nexport async function getRequestBody({ body, type }: GetRequestBody.Args): Promise<BodyInit | undefined> {\n if (type === \"form\") {\n return toQueryString(body, { arrayFormat: \"repeat\", encode: true });\n }\n if (type.includes(\"json\")) {\n return toJson(body);\n } else {\n return body as BodyInit;\n }\n}\n", "let Headers: typeof globalThis.Headers;\n\nif (typeof globalThis.Headers !== \"undefined\") {\n Headers = globalThis.Headers;\n} else {\n Headers = class Headers implements Headers {\n private headers: Map<string, string[]>;\n\n constructor(init?: HeadersInit) {\n this.headers = new Map();\n\n if (init) {\n if (init instanceof Headers) {\n init.forEach((value, key) => this.append(key, value));\n } else if (Array.isArray(init)) {\n for (const [key, value] of init) {\n if (typeof key === \"string\" && typeof value === \"string\") {\n this.append(key, value);\n } else {\n throw new TypeError(\"Each header entry must be a [string, string] tuple\");\n }\n }\n } else {\n for (const [key, value] of Object.entries(init)) {\n if (typeof value === \"string\") {\n this.append(key, value);\n } else {\n throw new TypeError(\"Header values must be strings\");\n }\n }\n }\n }\n }\n\n append(name: string, value: string): void {\n const key = name.toLowerCase();\n const existing = this.headers.get(key) || [];\n this.headers.set(key, [...existing, value]);\n }\n\n delete(name: string): void {\n const key = name.toLowerCase();\n this.headers.delete(key);\n }\n\n get(name: string): string | null {\n const key = name.toLowerCase();\n const values = this.headers.get(key);\n return values ? values.join(\", \") : null;\n }\n\n has(name: string): boolean {\n const key = name.toLowerCase();\n return this.headers.has(key);\n }\n\n set(name: string, value: string): void {\n const key = name.toLowerCase();\n this.headers.set(key, [value]);\n }\n\n forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: unknown): void {\n const boundCallback = thisArg ? callbackfn.bind(thisArg) : callbackfn;\n this.headers.forEach((values, key) => boundCallback(values.join(\", \"), key, this));\n }\n\n getSetCookie(): string[] {\n return this.headers.get(\"set-cookie\") || [];\n }\n\n *entries(): IterableIterator<[string, string]> {\n for (const [key, values] of this.headers.entries()) {\n yield [key, values.join(\", \")];\n }\n }\n\n *keys(): IterableIterator<string> {\n yield* this.headers.keys();\n }\n\n *values(): IterableIterator<string> {\n for (const values of this.headers.values()) {\n yield values.join(\", \");\n }\n }\n\n [Symbol.iterator](): IterableIterator<[string, string]> {\n return this.entries();\n }\n };\n}\n\nexport { Headers };\n", "export const TIMEOUT = \"timeout\";\n\nexport function getTimeoutSignal(timeoutMs: number): { signal: AbortSignal; abortId: ReturnType<typeof setTimeout> } {\n const controller = new AbortController();\n const abortId = setTimeout(() => controller.abort(TIMEOUT), timeoutMs);\n return { signal: controller.signal, abortId };\n}\n\nexport function anySignal(...args: AbortSignal[] | [AbortSignal[]]): AbortSignal {\n const signals = (args.length === 1 && Array.isArray(args[0]) ? args[0] : args) as AbortSignal[];\n\n const controller = new AbortController();\n\n for (const signal of signals) {\n if (signal.aborted) {\n controller.abort((signal as any)?.reason);\n return controller.signal;\n }\n\n signal.addEventListener(\"abort\", () => controller.abort((signal as any)?.reason), {\n signal: controller.signal,\n });\n\n // Re-check after adding listener: the signal may have aborted\n // between the initial `signal.aborted` check and the `addEventListener`\n // call above. If it did, the abort event was already dispatched and\n // the listener will never fire \u2014 we must manually abort.\n if (signal.aborted) {\n controller.abort((signal as any)?.reason);\n return controller.signal;\n }\n }\n\n return controller.signal;\n}\n", "import { anySignal, getTimeoutSignal, TIMEOUT } from \"./signals.js\";\n\n/**\n * Cached result of checking whether the current runtime supports\n * the `cache` option in `Request`. Some runtimes (e.g. Cloudflare Workers)\n * throw a TypeError when this option is used.\n */\nlet _cacheNoStoreSupported: boolean | undefined;\nexport function isCacheNoStoreSupported(): boolean {\n if (_cacheNoStoreSupported != null) {\n return _cacheNoStoreSupported;\n }\n try {\n new Request(\"http://localhost\", { cache: \"no-store\" });\n _cacheNoStoreSupported = true;\n } catch {\n _cacheNoStoreSupported = false;\n }\n return _cacheNoStoreSupported;\n}\n\n/**\n * Reset the cached result of `isCacheNoStoreSupported`. Exposed for testing only.\n */\nexport function resetCacheNoStoreSupported(): void {\n _cacheNoStoreSupported = undefined;\n}\n\nconst responseTimeouts = new WeakMap<Response, ReturnType<typeof setTimeout>>();\n\n/**\n * Clears the timeout that `makeRequest` kept running (with `keepTimeoutUntilBodyRead`) so that it also\n * covered reading the response body.\n */\nexport function clearResponseTimeout(response: Response): void {\n const timeoutId = responseTimeouts.get(response);\n if (timeoutId != null) {\n clearTimeout(timeoutId);\n responseTimeouts.delete(response);\n }\n}\n\nexport const makeRequest = async (\n fetchFn: (url: string, init: RequestInit) => Promise<Response>,\n url: string,\n method: string,\n headers: Headers | Record<string, string>,\n requestBody: BodyInit | undefined,\n timeoutMs?: number,\n abortSignal?: AbortSignal,\n withCredentials?: boolean,\n duplex?: \"half\",\n disableCache?: boolean,\n keepTimeoutUntilBodyRead?: boolean,\n): Promise<Response> => {\n const signals: AbortSignal[] = [];\n\n let timeoutAbortId: ReturnType<typeof setTimeout> | undefined;\n let timeoutSignal: AbortSignal | undefined;\n if (timeoutMs != null) {\n const { signal, abortId } = getTimeoutSignal(timeoutMs);\n timeoutAbortId = abortId;\n timeoutSignal = signal;\n signals.push(signal);\n }\n\n if (abortSignal != null) {\n signals.push(abortSignal);\n }\n const newSignals = anySignal(signals);\n let response: Response;\n try {\n response = await fetchFn(url, {\n method: method,\n headers,\n body: requestBody,\n signal: newSignals,\n credentials: withCredentials ? \"include\" : undefined,\n // @ts-ignore\n duplex,\n ...(disableCache && isCacheNoStoreSupported() ? { cache: \"no-store\" as RequestCache } : {}),\n });\n } catch (error) {\n if (timeoutAbortId != null) {\n clearTimeout(timeoutAbortId);\n }\n // Some runtimes (e.g. Node 18) reject with their own error instead of the abort reason.\n if (timeoutSignal?.aborted && !abortSignal?.aborted) {\n throw TIMEOUT;\n }\n throw error;\n }\n\n if (timeoutAbortId != null) {\n if (keepTimeoutUntilBodyRead) {\n responseTimeouts.set(response, timeoutAbortId);\n } else {\n clearTimeout(timeoutAbortId);\n }\n }\n\n return response;\n};\n", "import { Headers } from \"./Headers.js\";\n\n/**\n * The raw response from the fetch call excluding the body.\n */\nexport type RawResponse = Omit<\n {\n [K in keyof Response as Response[K] extends Function ? never : K]: Response[K]; // strips out functions\n },\n \"ok\" | \"body\" | \"bodyUsed\"\n>; // strips out body and bodyUsed\n\n/**\n * A raw response indicating that the request was aborted.\n */\nexport const abortRawResponse: RawResponse = {\n headers: new Headers(),\n redirected: false,\n status: 499,\n statusText: \"Client Closed Request\",\n type: \"error\",\n url: \"\",\n} as const;\n\n/**\n * A raw response indicating an unknown error.\n */\nexport const unknownRawResponse: RawResponse = {\n headers: new Headers(),\n redirected: false,\n status: 0,\n statusText: \"Unknown Error\",\n type: \"error\",\n url: \"\",\n} as const;\n\n/**\n * Converts a `RawResponse` object into a `RawResponse` by extracting its properties,\n * excluding the `body` and `bodyUsed` fields.\n *\n * @param response - The `RawResponse` object to convert.\n * @returns A `RawResponse` object containing the extracted properties of the input response.\n */\nexport function toRawResponse(response: Response): RawResponse {\n return {\n headers: response.headers,\n redirected: response.redirected,\n status: response.status,\n statusText: response.statusText,\n type: response.type,\n url: response.url,\n };\n}\n\n/**\n * Creates a `RawResponse` from a standard `Response` object.\n */\nexport interface WithRawResponse<T> {\n readonly data: T;\n readonly rawResponse: RawResponse;\n}\n", "export const SENSITIVE_QUERY_PARAMS: Set<string> = new Set([\n \"api_key\",\n \"api-key\",\n \"apikey\",\n \"token\",\n \"access_token\",\n \"access-token\",\n \"auth_token\",\n \"auth-token\",\n \"password\",\n \"passwd\",\n \"secret\",\n \"api_secret\",\n \"api-secret\",\n \"apisecret\",\n \"key\",\n \"session\",\n \"session_id\",\n \"session-id\",\n]);\n\nexport function redactUrl(url: string): string {\n const protocolIndex = url.indexOf(\"://\");\n if (protocolIndex === -1) return url;\n\n const afterProtocol = protocolIndex + 3;\n\n // Find the first delimiter that marks the end of the authority section\n const pathStart = url.indexOf(\"/\", afterProtocol);\n let queryStart = url.indexOf(\"?\", afterProtocol);\n let fragmentStart = url.indexOf(\"#\", afterProtocol);\n\n const firstDelimiter = Math.min(\n pathStart === -1 ? url.length : pathStart,\n queryStart === -1 ? url.length : queryStart,\n fragmentStart === -1 ? url.length : fragmentStart,\n );\n\n // Find the LAST @ before the delimiter (handles multiple @ in credentials)\n let atIndex = -1;\n for (let i = afterProtocol; i < firstDelimiter; i++) {\n if (url[i] === \"@\") {\n atIndex = i;\n }\n }\n\n if (atIndex !== -1) {\n url = `${url.slice(0, afterProtocol)}[REDACTED]@${url.slice(atIndex + 1)}`;\n }\n\n // Recalculate queryStart since url might have changed\n queryStart = url.indexOf(\"?\");\n if (queryStart === -1) return url;\n\n fragmentStart = url.indexOf(\"#\", queryStart);\n const queryEnd = fragmentStart !== -1 ? fragmentStart : url.length;\n const queryString = url.slice(queryStart + 1, queryEnd);\n\n if (queryString.length === 0) return url;\n\n // FAST PATH: Quick check if any sensitive keywords present\n // Using indexOf is faster than regex for simple substring matching\n const lower = queryString.toLowerCase();\n const hasSensitive =\n lower.includes(\"token\") ||\n lower.includes(\"key\") ||\n lower.includes(\"password\") ||\n lower.includes(\"passwd\") ||\n lower.includes(\"secret\") ||\n lower.includes(\"session\") ||\n lower.includes(\"auth\");\n\n if (!hasSensitive) {\n return url;\n }\n\n // SLOW PATH: Parse and redact\n const redactedParams: string[] = [];\n const params = queryString.split(\"&\");\n\n for (const param of params) {\n const equalIndex = param.indexOf(\"=\");\n if (equalIndex === -1) {\n redactedParams.push(param);\n continue;\n }\n\n const key = param.slice(0, equalIndex);\n let shouldRedact = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase());\n\n if (!shouldRedact && key.includes(\"%\")) {\n try {\n const decodedKey = decodeURIComponent(key);\n shouldRedact = SENSITIVE_QUERY_PARAMS.has(decodedKey.toLowerCase());\n } catch {}\n }\n\n redactedParams.push(shouldRedact ? `${key}=[REDACTED]` : param);\n }\n\n return url.slice(0, queryStart + 1) + redactedParams.join(\"&\") + url.slice(queryEnd);\n}\n", "const INITIAL_RETRY_DELAY = 1000; // in milliseconds\nconst MAX_RETRY_DELAY = 60000; // in milliseconds\nconst DEFAULT_MAX_RETRIES = 2;\nconst JITTER_FACTOR = 0.2; // 20% random jitter\n\nfunction isRetryableStatusCode(statusCode: number): boolean {\n return [408, 429].includes(statusCode) || statusCode >= 500;\n}\n\nfunction addPositiveJitter(delay: number): number {\n const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR;\n return delay * jitterMultiplier;\n}\n\nfunction addSymmetricJitter(delay: number): number {\n const jitterMultiplier = 1 + (Math.random() - 0.5) * JITTER_FACTOR;\n return delay * jitterMultiplier;\n}\n\nfunction getRetryDelayFromHeaders(response: Response, retryAttempt: number): number {\n const retryAfter = response.headers.get(\"Retry-After\");\n if (retryAfter) {\n const retryAfterSeconds = parseInt(retryAfter, 10);\n if (!Number.isNaN(retryAfterSeconds) && retryAfterSeconds > 0) {\n return Math.min(retryAfterSeconds * 1000, MAX_RETRY_DELAY);\n }\n\n const retryAfterDate = new Date(retryAfter);\n if (!Number.isNaN(retryAfterDate.getTime())) {\n const delay = retryAfterDate.getTime() - Date.now();\n if (delay > 0) {\n return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY);\n }\n }\n }\n\n const rateLimitReset = response.headers.get(\"X-RateLimit-Reset\");\n if (rateLimitReset) {\n const resetTime = parseInt(rateLimitReset, 10);\n if (!Number.isNaN(resetTime)) {\n const delay = resetTime * 1000 - Date.now();\n if (delay > 0) {\n return addPositiveJitter(Math.min(delay, MAX_RETRY_DELAY));\n }\n }\n }\n\n return addSymmetricJitter(Math.min(INITIAL_RETRY_DELAY * 2 ** retryAttempt, MAX_RETRY_DELAY));\n}\n\n/**\n * Waits `ms` milliseconds, or rejects as soon as `abortSignal` aborts. The timer and\n * the abort listener are always removed, so a cancelled wait never keeps the process alive.\n */\nfunction sleep(ms: number, abortSignal: AbortSignal | undefined): Promise<void> {\n return new Promise((resolve, reject) => {\n if (abortSignal?.aborted) {\n reject(abortSignal.reason);\n return;\n }\n const onAbort = () => {\n clearTimeout(timeoutId);\n reject(abortSignal?.reason);\n };\n const timeoutId = setTimeout(() => {\n abortSignal?.removeEventListener(\"abort\", onAbort);\n resolve();\n }, ms);\n abortSignal?.addEventListener(\"abort\", onAbort, { once: true });\n });\n}\n\nexport async function requestWithRetries(\n requestFn: () => Promise<Response>,\n maxRetries: number = DEFAULT_MAX_RETRIES,\n abortSignal?: AbortSignal,\n): Promise<Response> {\n let response: Response = await requestFn();\n\n for (let i = 0; i < maxRetries; ++i) {\n if (isRetryableStatusCode(response.status)) {\n const delay = getRetryDelayFromHeaders(response, i);\n\n await sleep(delay, abortSignal);\n response = await requestFn();\n } else {\n break;\n }\n }\n return response!;\n}\n", "import { toJson } from \"../json.js\";\nimport { createLogger, type LogConfig, type Logger } from \"../logging/logger.js\";\nimport type { APIResponse } from \"./APIResponse.js\";\nimport { createRequestUrl } from \"./createRequestUrl.js\";\nimport type { EndpointMetadata } from \"./EndpointMetadata.js\";\nimport { EndpointSupplier } from \"./EndpointSupplier.js\";\nimport { getErrorResponseBody } from \"./getErrorResponseBody.js\";\nimport { getFetchFn } from \"./getFetchFn.js\";\nimport { getRequestBody } from \"./getRequestBody.js\";\nimport { getResponseBody, isResponseBodyError } from \"./getResponseBody.js\";\nimport { Headers } from \"./Headers.js\";\nimport { clearResponseTimeout, makeRequest } from \"./makeRequest.js\";\nimport { abortRawResponse, toRawResponse, unknownRawResponse } from \"./RawResponse.js\";\nimport { redactUrl, SENSITIVE_QUERY_PARAMS } from \"./redactUrl.js\";\nimport { requestWithRetries } from \"./requestWithRetries.js\";\nimport { TIMEOUT } from \"./signals.js\";\n\nexport type FetchFunction = <R = unknown>(args: Fetcher.Args) => Promise<APIResponse<R, Fetcher.Error>>;\n\nexport declare namespace Fetcher {\n export interface Args {\n url: string;\n method: string;\n contentType?: string;\n headers?: Record<string, unknown>;\n /**\n * @deprecated Prefer `queryString` (produced by `core.url.queryBuilder()`).\n * Retained for backwards compatibility with custom fetchers and callers that\n * still construct request args with a query-parameter object.\n */\n queryParameters?: Record<string, unknown>;\n queryString?: string;\n body?: unknown;\n timeoutMs?: number;\n maxRetries?: number;\n withCredentials?: boolean;\n abortSignal?: AbortSignal;\n requestType?: \"json\" | \"file\" | \"bytes\" | \"form\" | \"other\";\n responseType?: \"json\" | \"blob\" | \"sse\" | \"streaming\" | \"text\" | \"arrayBuffer\" | \"binary-response\";\n duplex?: \"half\";\n endpointMetadata?: EndpointMetadata;\n fetchFn?: typeof fetch;\n logging?: LogConfig | Logger;\n }\n\n export type Error = FailedStatusCodeError | NonJsonError | BodyIsNullError | TimeoutError | UnknownError;\n\n export interface FailedStatusCodeError {\n reason: \"status-code\";\n statusCode: number;\n body: unknown;\n }\n\n export interface NonJsonError {\n reason: \"non-json\";\n statusCode: number;\n rawBody: string;\n }\n\n export interface BodyIsNullError {\n reason: \"body-is-null\";\n statusCode: number;\n }\n\n export interface TimeoutError {\n reason: \"timeout\";\n cause?: unknown;\n }\n\n export interface UnknownError {\n reason: \"unknown\";\n errorMessage: string;\n cause?: unknown;\n }\n}\n\nconst SENSITIVE_HEADERS = new Set([\n \"authorization\",\n \"www-authenticate\",\n \"x-api-key\",\n \"api-key\",\n \"apikey\",\n \"x-api-token\",\n \"x-auth-token\",\n \"auth-token\",\n \"cookie\",\n \"set-cookie\",\n \"proxy-authorization\",\n \"proxy-authenticate\",\n \"x-csrf-token\",\n \"x-xsrf-token\",\n \"x-session-token\",\n \"x-access-token\",\n]);\n\nfunction redactHeaders(headers: Headers | Record<string, string>): Record<string, string> {\n const filtered: Record<string, string> = {};\n for (const [key, value] of headers instanceof Headers ? headers.entries() : Object.entries(headers)) {\n if (SENSITIVE_HEADERS.has(key.toLowerCase())) {\n filtered[key] = \"[REDACTED]\";\n } else {\n filtered[key] = value;\n }\n }\n return filtered;\n}\n\nfunction redactQueryParameters(\n queryParameters: Record<string, unknown> | undefined,\n): Record<string, unknown> | undefined {\n if (queryParameters == null) {\n return undefined;\n }\n const redacted: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(queryParameters)) {\n redacted[key] = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase()) ? \"[REDACTED]\" : value;\n }\n return redacted;\n}\n\nasync function getHeaders(args: Fetcher.Args): Promise<Headers> {\n const newHeaders: Headers = new Headers();\n\n newHeaders.set(\n \"Accept\",\n args.responseType === \"json\"\n ? \"application/json\"\n : args.responseType === \"text\"\n ? \"text/plain\"\n : args.responseType === \"sse\"\n ? \"text/event-stream\"\n : \"*/*\",\n );\n if (args.body !== undefined && args.contentType != null) {\n newHeaders.set(\"Content-Type\", args.contentType);\n }\n\n if (args.headers == null) {\n return newHeaders;\n }\n\n for (const [key, value] of Object.entries(args.headers)) {\n const result = await EndpointSupplier.get(value, { endpointMetadata: args.endpointMetadata ?? {} });\n if (typeof result === \"string\") {\n newHeaders.set(key, result);\n continue;\n }\n if (result == null) {\n continue;\n }\n newHeaders.set(key, `${result}`);\n }\n return newHeaders;\n}\n\nfunction isJsonContentType(contentType: string | null): boolean {\n const mediaType = contentType?.split(\";\")[0]?.trim().toLowerCase() ?? \"\";\n return mediaType === \"application/json\" || mediaType === \"text/json\" || mediaType.endsWith(\"+json\");\n}\n\nexport async function fetcherImpl<R = unknown>(args: Fetcher.Args): Promise<APIResponse<R, Fetcher.Error>> {\n let url = args.url;\n if (args.queryString != null && args.queryString.length > 0) {\n url = `${url}?${args.queryString}`;\n } else {\n url = createRequestUrl(args.url, args.queryParameters);\n }\n const requestBody: BodyInit | undefined = await getRequestBody({\n body: args.body,\n type: args.requestType ?? \"other\",\n });\n const fetchFn = args.fetchFn ?? (await getFetchFn());\n const headers = await getHeaders(args);\n const logger = createLogger(args.logging);\n\n if (logger.isDebug()) {\n const metadata = {\n method: args.method,\n url: redactUrl(url),\n headers: redactHeaders(headers),\n queryParameters: redactQueryParameters(args.queryParameters),\n hasBody: requestBody != null,\n };\n logger.debug(\"Making HTTP request\", metadata);\n }\n\n // Bodies that are read in full here stay covered by the timeout; streamed bodies are read by the caller.\n const keepTimeoutUntilBodyRead =\n args.responseType !== \"streaming\" && args.responseType !== \"sse\" && args.responseType !== \"binary-response\";\n const attemptResponses: Response[] = [];\n try {\n const response = await requestWithRetries(\n async () => {\n // A retry means the previous attempt is over; stop its timer now rather than at the end.\n for (const previousResponse of attemptResponses) {\n clearResponseTimeout(previousResponse);\n }\n const attemptResponse = await makeRequest(\n fetchFn,\n url,\n args.method,\n headers,\n requestBody,\n args.timeoutMs,\n args.abortSignal,\n args.withCredentials,\n args.duplex,\n args.responseType === \"streaming\" || args.responseType === \"sse\",\n keepTimeoutUntilBodyRead,\n );\n attemptResponses.push(attemptResponse);\n return attemptResponse;\n },\n args.maxRetries,\n args.abortSignal,\n );\n\n if (response.status >= 200 && response.status < 400) {\n if (logger.isDebug()) {\n const metadata = {\n method: args.method,\n url: redactUrl(url),\n statusCode: response.status,\n responseHeaders: redactHeaders(response.headers),\n };\n logger.debug(\"HTTP request succeeded\", metadata);\n }\n const body = await getResponseBody(response, args.responseType);\n // Only a body the server labelled as JSON is an error here; void endpoints may return plain text.\n if (\n isResponseBodyError(body) &&\n body.error.reason === \"non-json\" &&\n isJsonContentType(response.headers.get(\"Content-Type\"))\n ) {\n return {\n ok: false,\n error: body.error,\n rawResponse: toRawResponse(response),\n };\n }\n return {\n ok: true,\n body: body as R,\n headers: response.headers,\n rawResponse: toRawResponse(response),\n };\n } else {\n if (logger.isError()) {\n const metadata = {\n method: args.method,\n url: redactUrl(url),\n statusCode: response.status,\n responseHeaders: redactHeaders(Object.fromEntries(response.headers.entries())),\n };\n logger.error(\"HTTP request failed with error status\", metadata);\n }\n return {\n ok: false,\n error: {\n reason: \"status-code\",\n statusCode: response.status,\n body: await getErrorResponseBody(response),\n },\n rawResponse: toRawResponse(response),\n };\n }\n } catch (error) {\n if (args.abortSignal?.aborted) {\n if (logger.isError()) {\n const metadata = {\n method: args.method,\n url: redactUrl(url),\n };\n logger.error(\"HTTP request was aborted\", metadata);\n }\n return {\n ok: false,\n error: {\n reason: \"unknown\",\n errorMessage: \"The user aborted a request\",\n cause: error,\n },\n rawResponse: abortRawResponse,\n };\n } else if (error === TIMEOUT || (error instanceof Error && error.name === \"AbortError\")) {\n if (logger.isError()) {\n const metadata = {\n method: args.method,\n url: redactUrl(url),\n timeoutMs: args.timeoutMs,\n };\n logger.error(\"HTTP request timed out\", metadata);\n }\n return {\n ok: false,\n error: {\n reason: \"timeout\",\n cause: error,\n },\n rawResponse: abortRawResponse,\n };\n } else if (error instanceof Error) {\n if (logger.isError()) {\n const metadata = {\n method: args.method,\n url: redactUrl(url),\n errorMessage: error.message,\n };\n logger.error(\"HTTP request failed with error\", metadata);\n }\n return {\n ok: false,\n error: {\n reason: \"unknown\",\n errorMessage: error.message,\n cause: error,\n },\n rawResponse: unknownRawResponse,\n };\n }\n\n if (logger.isError()) {\n const metadata = {\n method: args.method,\n url: redactUrl(url),\n error: toJson(error),\n };\n logger.error(\"HTTP request failed with unknown error\", metadata);\n }\n return {\n ok: false,\n error: {\n reason: \"unknown\",\n errorMessage: toJson(error),\n cause: error,\n },\n rawResponse: unknownRawResponse,\n };\n } finally {\n for (const attemptResponse of attemptResponses) {\n clearResponseTimeout(attemptResponse);\n }\n }\n}\n\nexport const fetcher: FetchFunction = fetcherImpl;\n", "import type { WithRawResponse } from \"./RawResponse.js\";\n\n/**\n * A promise that returns the parsed response and lets you retrieve the raw response too.\n */\nexport class HttpResponsePromise<T> extends Promise<T> {\n private innerPromise: Promise<WithRawResponse<T>>;\n private unwrappedPromise: Promise<T> | undefined;\n\n private constructor(promise: Promise<WithRawResponse<T>>) {\n // Initialize with a no-op to avoid premature parsing\n super((resolve) => {\n resolve(undefined as unknown as T);\n });\n this.innerPromise = promise;\n }\n\n /**\n * Creates an `HttpResponsePromise` from a function that returns a promise.\n *\n * @param fn - A function that returns a promise resolving to a `WithRawResponse` object.\n * @param args - Arguments to pass to the function.\n * @returns An `HttpResponsePromise` instance.\n */\n public static fromFunction<F extends (...args: never[]) => Promise<WithRawResponse<T>>, T>(\n fn: F,\n ...args: Parameters<F>\n ): HttpResponsePromise<T> {\n return new HttpResponsePromise<T>(fn(...args));\n }\n\n /**\n * Creates a function that returns an `HttpResponsePromise` from a function that returns a promise.\n *\n * @param fn - A function that returns a promise resolving to a `WithRawResponse` object.\n * @returns A function that returns an `HttpResponsePromise` instance.\n */\n public static interceptFunction<\n F extends (...args: never[]) => Promise<WithRawResponse<T>>,\n T = Awaited<ReturnType<F>>[\"data\"],\n >(fn: F): (...args: Parameters<F>) => HttpResponsePromise<T> {\n return (...args: Parameters<F>): HttpResponsePromise<T> => {\n return HttpResponsePromise.fromPromise<T>(fn(...args));\n };\n }\n\n /**\n * Creates an `HttpResponsePromise` from an existing promise.\n *\n * @param promise - A promise resolving to a `WithRawResponse` object.\n * @returns An `HttpResponsePromise` instance.\n */\n public static fromPromise<T>(promise: Promise<WithRawResponse<T>>): HttpResponsePromise<T> {\n return new HttpResponsePromise<T>(promise);\n }\n\n /**\n * Creates an `HttpResponsePromise` from an executor function.\n *\n * @param executor - A function that takes resolve and reject callbacks to create a promise.\n * @returns An `HttpResponsePromise` instance.\n */\n public static fromExecutor<T>(\n executor: (resolve: (value: WithRawResponse<T>) => void, reject: (reason?: unknown) => void) => void,\n ): HttpResponsePromise<T> {\n const promise = new Promise<WithRawResponse<T>>(executor);\n return new HttpResponsePromise<T>(promise);\n }\n\n /**\n * Creates an `HttpResponsePromise` from a resolved result.\n *\n * @param result - A `WithRawResponse` object to resolve immediately.\n * @returns An `HttpResponsePromise` instance.\n */\n public static fromResult<T>(result: WithRawResponse<T>): HttpResponsePromise<T> {\n const promise = Promise.resolve(result);\n return new HttpResponsePromise<T>(promise);\n }\n\n private unwrap(): Promise<T> {\n if (!this.unwrappedPromise) {\n this.unwrappedPromise = this.innerPromise.then(({ data }) => data);\n }\n return this.unwrappedPromise;\n }\n\n /** @inheritdoc */\n public override then<TResult1 = T, TResult2 = never>(\n onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,\n onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null,\n ): Promise<TResult1 | TResult2> {\n return this.unwrap().then(onfulfilled, onrejected);\n }\n\n /** @inheritdoc */\n public override catch<TResult = never>(\n onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null,\n ): Promise<T | TResult> {\n return this.unwrap().catch(onrejected);\n }\n\n /** @inheritdoc */\n public override finally(onfinally?: (() => void) | null): Promise<T> {\n return this.unwrap().finally(onfinally);\n }\n\n /**\n * Retrieves the data and raw response.\n *\n * @returns A promise resolving to a `WithRawResponse` object.\n */\n public async withRawResponse(): Promise<WithRawResponse<T>> {\n return await this.innerPromise;\n }\n}\n", "export function join(base: string, ...segments: string[]): string {\n if (!base) {\n return \"\";\n }\n\n if (segments.length === 0) {\n return base;\n }\n\n if (base.includes(\"://\")) {\n let url: URL;\n try {\n url = new URL(base);\n } catch {\n return joinPath(base, ...segments);\n }\n\n const lastSegment = segments[segments.length - 1];\n const shouldPreserveTrailingSlash = lastSegment?.endsWith(\"/\");\n\n for (const segment of segments) {\n const cleanSegment = trimSlashes(segment);\n if (cleanSegment) {\n url.pathname = joinPathSegments(url.pathname, cleanSegment);\n }\n }\n\n if (shouldPreserveTrailingSlash && !url.pathname.endsWith(\"/\")) {\n url.pathname += \"/\";\n }\n\n return url.toString();\n }\n\n return joinPath(base, ...segments);\n}\n\nfunction joinPath(base: string, ...segments: string[]): string {\n if (segments.length === 0) {\n return base;\n }\n\n let result = base;\n\n const lastSegment = segments[segments.length - 1];\n const shouldPreserveTrailingSlash = lastSegment?.endsWith(\"/\");\n\n for (const segment of segments) {\n const cleanSegment = trimSlashes(segment);\n if (cleanSegment) {\n result = joinPathSegments(result, cleanSegment);\n }\n }\n\n if (shouldPreserveTrailingSlash && !result.endsWith(\"/\")) {\n result += \"/\";\n }\n\n return result;\n}\n\nfunction joinPathSegments(left: string, right: string): string {\n if (left.endsWith(\"/\")) {\n return left + right;\n }\n return `${left}/${right}`;\n}\n\nfunction trimSlashes(str: string): string {\n if (!str) return str;\n\n let start = 0;\n let end = str.length;\n\n if (str.startsWith(\"/\")) start = 1;\n if (str.endsWith(\"/\")) end = str.length - 1;\n\n return start === 0 && end === str.length ? str : str.slice(start, end);\n}\n", "export type Supplier<T> = T | Promise<T> | (() => T | Promise<T>);\n\nexport const Supplier = {\n get: async <T>(supplier: Supplier<T>): Promise<T> => {\n if (typeof supplier === \"function\") {\n return (supplier as () => T)();\n } else {\n return supplier;\n }\n },\n};\n", "import { createLogger, type LogConfig, type Logger } from \"../logging/logger.js\";\nimport { join } from \"../url/join.js\";\nimport { EndpointSupplier } from \"./EndpointSupplier.js\";\nimport { getFetchFn } from \"./getFetchFn.js\";\nimport { makeRequest } from \"./makeRequest.js\";\nimport { redactUrl } from \"./redactUrl.js\";\nimport { requestWithRetries } from \"./requestWithRetries.js\";\nimport { Supplier } from \"./Supplier.js\";\nimport { TIMEOUT } from \"./signals.js\";\n\nexport declare namespace PassthroughRequest {\n /**\n * Per-request options that can override the SDK client defaults.\n */\n export interface RequestOptions {\n /** Override the default timeout for this request (in seconds). */\n timeoutInSeconds?: number;\n /** Override the default number of retries for this request. */\n maxRetries?: number;\n /** Additional headers to include in this request. */\n headers?: Record<string, string>;\n /** Abort signal for this request. */\n abortSignal?: AbortSignal;\n }\n\n /**\n * SDK client configuration used by the passthrough fetch method.\n */\n export interface ClientOptions {\n /** The base URL or environment for the client. */\n environment?: Supplier<string>;\n /** Override the base URL. */\n baseUrl?: Supplier<string>;\n /** Default headers to include in requests. */\n headers?: Record<string, unknown>;\n /** Default maximum time to wait for a response in seconds. */\n timeoutInSeconds?: number;\n /** Default number of times to retry the request. Defaults to 2. */\n maxRetries?: number;\n /** A custom fetch function. */\n fetch?: typeof fetch;\n /** Logging configuration. */\n logging?: LogConfig | Logger;\n /** A function that returns auth headers. */\n getAuthHeaders?: () => Promise<Record<string, string>>;\n }\n}\n\n/**\n * Makes a passthrough HTTP request using the SDK's configuration (auth, retry, logging, etc.)\n * while mimicking the standard `fetch` API.\n *\n * @param input - The URL, path, or Request object. If a relative path, it will be resolved against the configured base URL.\n * @param init - Standard RequestInit options (method, headers, body, signal, etc.)\n * @param clientOptions - SDK client options (auth, default headers, logging, etc.)\n * @param requestOptions - Per-request overrides (timeout, retries, extra headers, abort signal).\n * @returns A standard Response object.\n */\nexport async function makePassthroughRequest(\n input: Request | string | URL,\n init: RequestInit | undefined,\n clientOptions: PassthroughRequest.ClientOptions,\n requestOptions?: PassthroughRequest.RequestOptions,\n): Promise<Response> {\n const logger = createLogger(clientOptions.logging);\n\n // Extract URL and default init properties from Request object if provided\n let url: string;\n let effectiveInit: RequestInit | undefined = init;\n if (input instanceof Request) {\n url = input.url;\n // If no explicit init provided, extract properties from the Request object\n if (init == null) {\n effectiveInit = {\n method: input.method,\n headers: Object.fromEntries(input.headers.entries()),\n body: input.body,\n signal: input.signal,\n credentials: input.credentials,\n cache: input.cache as RequestCache,\n redirect: input.redirect,\n referrer: input.referrer,\n integrity: input.integrity,\n mode: input.mode,\n };\n }\n } else {\n url = input instanceof URL ? input.toString() : input;\n }\n\n // Resolve the base URL\n const baseUrl =\n (clientOptions.baseUrl != null ? await Supplier.get(clientOptions.baseUrl) : undefined) ??\n (clientOptions.environment != null ? await Supplier.get(clientOptions.environment) : undefined);\n\n // Determine the full URL\n let fullUrl: string;\n if (url.startsWith(\"http://\") || url.startsWith(\"https://\")) {\n fullUrl = url;\n } else if (baseUrl != null) {\n fullUrl = join(baseUrl, url);\n } else {\n fullUrl = url;\n }\n\n // Merge headers: SDK default headers -> auth headers -> user-provided headers\n const mergedHeaders: Record<string, string> = {};\n\n // Apply SDK default headers (resolve suppliers)\n if (clientOptions.headers != null) {\n for (const [key, value] of Object.entries(clientOptions.headers)) {\n const resolved = await EndpointSupplier.get(value, { endpointMetadata: {} });\n if (resolved != null) {\n mergedHeaders[key.toLowerCase()] = `${resolved}`;\n }\n }\n }\n\n // Apply auth headers, but only when the resolved URL targets the configured base URL.\n // This prevents the SDK's credentials from leaking to an unrelated host when a caller\n // passes an absolute cross-origin URL into the passthrough fetch escape hatch.\n if (clientOptions.getAuthHeaders != null && targetsBaseUrl(fullUrl, baseUrl)) {\n const authHeaders = await clientOptions.getAuthHeaders();\n for (const [key, value] of Object.entries(authHeaders)) {\n mergedHeaders[key.toLowerCase()] = value;\n }\n }\n\n // Apply user-provided headers from init\n if (effectiveInit?.headers != null) {\n const initHeaders =\n effectiveInit.headers instanceof Headers\n ? Object.fromEntries(effectiveInit.headers.entries())\n : Array.isArray(effectiveInit.headers)\n ? Object.fromEntries(effectiveInit.headers)\n : effectiveInit.headers;\n for (const [key, value] of Object.entries(initHeaders)) {\n if (value != null) {\n mergedHeaders[key.toLowerCase()] = value;\n }\n }\n }\n\n // Apply per-request option headers (highest priority)\n if (requestOptions?.headers != null) {\n for (const [key, value] of Object.entries(requestOptions.headers)) {\n mergedHeaders[key.toLowerCase()] = value;\n }\n }\n\n const method = effectiveInit?.method ?? \"GET\";\n const body = effectiveInit?.body;\n const timeoutInSeconds = requestOptions?.timeoutInSeconds ?? clientOptions.timeoutInSeconds;\n const timeoutMs = timeoutInSeconds != null ? timeoutInSeconds * 1000 : undefined;\n const maxRetries = requestOptions?.maxRetries ?? clientOptions.maxRetries;\n const abortSignal = requestOptions?.abortSignal ?? effectiveInit?.signal ?? undefined;\n const fetchFn = clientOptions.fetch ?? (await getFetchFn());\n\n if (logger.isDebug()) {\n logger.debug(\"Making passthrough HTTP request\", {\n method,\n url: redactUrl(fullUrl),\n hasBody: body != null,\n });\n }\n\n let response: Response;\n try {\n response = await requestWithRetries(\n async () =>\n makeRequest(\n fetchFn,\n fullUrl,\n method,\n mergedHeaders,\n body ?? undefined,\n timeoutMs,\n abortSignal,\n effectiveInit?.credentials === \"include\",\n undefined, // duplex\n false, // disableCache\n ),\n maxRetries,\n abortSignal,\n );\n } catch (error) {\n // Match `fetch`: a timeout rejects with an Error named \"TimeoutError\", not the bare abort reason.\n if (error === TIMEOUT) {\n throw createTimeoutError();\n }\n throw error;\n }\n\n if (logger.isDebug()) {\n logger.debug(\"Passthrough HTTP request completed\", {\n method,\n url: redactUrl(fullUrl),\n statusCode: response.status,\n });\n }\n\n return response;\n}\n\nfunction createTimeoutError(): Error {\n const error = new Error(\"The request timed out.\");\n error.name = \"TimeoutError\";\n return error;\n}\n\n/**\n * Returns true when the resolved request URL points at the same origin as the\n * configured base URL. Relative paths are always joined onto the base URL, so\n * they resolve to the base origin and return true. Absolute URLs only match when\n * their origin equals the base origin. When there is no base URL to compare\n * against, or either value is not a parseable absolute URL, this returns false so\n * auth headers are not attached.\n */\nfunction targetsBaseUrl(fullUrl: string, baseUrl: string | undefined): boolean {\n if (baseUrl == null) {\n return false;\n }\n try {\n return new URL(fullUrl).origin === new URL(baseUrl).origin;\n } catch {\n return false;\n }\n}\n", "import type { Uploadable } from \"./types.js\";\n\nexport async function toBinaryUploadRequest(\n file: Uploadable,\n): Promise<{ body: Uploadable.FileLike; headers?: Record<string, string> }> {\n const { data, filename, contentLength, contentType } = await getFileWithMetadata(file);\n const request = {\n body: data,\n headers: {} as Record<string, string>,\n };\n if (filename) {\n request.headers[\"Content-Disposition\"] = `attachment; filename=\"${filename}\"`;\n }\n if (contentType) {\n request.headers[\"Content-Type\"] = contentType;\n }\n if (contentLength != null) {\n request.headers[\"Content-Length\"] = contentLength.toString();\n }\n return request;\n}\n\nexport async function toMultipartDataPart(\n file: Uploadable,\n): Promise<{ data: Uploadable.FileLike; filename?: string; contentType?: string }> {\n const { data, filename, contentType } = await getFileWithMetadata(file, {\n noSniffFileSize: true,\n });\n return {\n data,\n filename,\n contentType,\n };\n}\n\nasync function getFileWithMetadata(\n file: Uploadable,\n { noSniffFileSize }: { noSniffFileSize?: boolean } = {},\n): Promise<Uploadable.WithMetadata> {\n if (file == null) {\n throw new Error(\n `Expected file to be a Blob, Buffer, ReadableStream, or an object with a \"path\" or \"data\" property, but received ${file === null ? \"null\" : \"undefined\"}.`,\n );\n }\n if (isFileLike(file)) {\n return getFileWithMetadata(\n {\n data: file,\n },\n { noSniffFileSize },\n );\n }\n\n if (\"path\" in file) {\n const fs = await import(\"fs\");\n if (!fs?.createReadStream) {\n throw new Error(\"File path uploads are not supported in this environment.\");\n }\n const data = fs.createReadStream(file.path);\n const contentLength =\n file.contentLength ?? (noSniffFileSize === true ? undefined : await tryGetFileSizeFromPath(file.path));\n const filename = file.filename ?? getNameFromPath(file.path);\n return {\n data,\n filename,\n contentType: file.contentType,\n contentLength,\n };\n }\n if (\"data\" in file) {\n const data = file.data;\n const contentLength =\n file.contentLength ??\n (await tryGetContentLengthFromFileLike(data, {\n noSniffFileSize,\n }));\n const filename = file.filename ?? tryGetNameFromFileLike(data);\n return {\n data,\n filename,\n contentType: file.contentType ?? tryGetContentTypeFromFileLike(data),\n contentLength,\n };\n }\n\n throw new Error(`Invalid FileUpload of type ${typeof file}: ${JSON.stringify(file)}`);\n}\n\nfunction isFileLike(value: unknown): value is Uploadable.FileLike {\n return (\n isBuffer(value) ||\n isArrayBufferView(value) ||\n isArrayBuffer(value) ||\n isUint8Array(value) ||\n isBlob(value) ||\n isFile(value) ||\n isStreamLike(value) ||\n isReadableStream(value)\n );\n}\n\nasync function tryGetFileSizeFromPath(path: string): Promise<number | undefined> {\n try {\n const fs = await import(\"fs\");\n if (!fs?.promises?.stat) {\n return undefined;\n }\n const fileStat = await fs.promises.stat(path);\n return fileStat.size;\n } catch (_fallbackError) {\n return undefined;\n }\n}\n\nfunction tryGetNameFromFileLike(data: Uploadable.FileLike): string | undefined {\n if (isNamedValue(data)) {\n return data.name;\n }\n if (isPathedValue(data)) {\n return getNameFromPath(data.path.toString());\n }\n return undefined;\n}\n\nasync function tryGetContentLengthFromFileLike(\n data: Uploadable.FileLike,\n { noSniffFileSize }: { noSniffFileSize?: boolean } = {},\n): Promise<number | undefined> {\n if (isBuffer(data)) {\n return data.length;\n }\n if (isArrayBufferView(data)) {\n return data.byteLength;\n }\n if (isArrayBuffer(data)) {\n return data.byteLength;\n }\n if (isBlob(data)) {\n return data.size;\n }\n if (isFile(data)) {\n return data.size;\n }\n if (noSniffFileSize === true) {\n return undefined;\n }\n if (isPathedValue(data)) {\n return await tryGetFileSizeFromPath(data.path.toString());\n }\n return undefined;\n}\n\nfunction tryGetContentTypeFromFileLike(data: Uploadable.FileLike): string | undefined {\n if (isBlob(data)) {\n return data.type;\n }\n if (isFile(data)) {\n return data.type;\n }\n\n return undefined;\n}\n\nfunction getNameFromPath(path: string): string | undefined {\n const lastForwardSlash = path.lastIndexOf(\"/\");\n const lastBackSlash = path.lastIndexOf(\"\\\\\");\n const lastSlashIndex = Math.max(lastForwardSlash, lastBackSlash);\n return lastSlashIndex >= 0 ? path.substring(lastSlashIndex + 1) : path;\n}\n\ntype NamedValue = {\n name: string;\n} & unknown;\n\ntype PathedValue = {\n path: string | { toString(): string };\n} & unknown;\n\ntype StreamLike = {\n read?: () => unknown;\n pipe?: (dest: unknown) => unknown;\n} & unknown;\n\nfunction isNamedValue(value: unknown): value is NamedValue {\n return typeof value === \"object\" && value != null && \"name\" in value;\n}\n\nfunction isPathedValue(value: unknown): value is PathedValue {\n return typeof value === \"object\" && value != null && \"path\" in value;\n}\n\nfunction isStreamLike(value: unknown): value is StreamLike {\n return typeof value === \"object\" && value != null && (\"read\" in value || \"pipe\" in value);\n}\n\nfunction isReadableStream(value: unknown): value is ReadableStream {\n return typeof value === \"object\" && value != null && \"getReader\" in value;\n}\n\nfunction isBuffer(value: unknown): value is Buffer {\n return typeof Buffer !== \"undefined\" && Buffer.isBuffer && Buffer.isBuffer(value);\n}\n\nfunction isArrayBufferView(value: unknown): value is ArrayBufferView {\n return typeof ArrayBuffer !== \"undefined\" && ArrayBuffer.isView(value);\n}\n\nfunction isArrayBuffer(value: unknown): value is ArrayBuffer {\n return typeof ArrayBuffer !== \"undefined\" && value instanceof ArrayBuffer;\n}\n\nfunction isUint8Array(value: unknown): value is Uint8Array {\n return typeof Uint8Array !== \"undefined\" && value instanceof Uint8Array;\n}\n\nfunction isBlob(value: unknown): value is Blob {\n return typeof Blob !== \"undefined\" && value instanceof Blob;\n}\n\nfunction isFile(value: unknown): value is File {\n return typeof File !== \"undefined\" && value instanceof File;\n}\n", "interface DenoGlobal {\n version: {\n deno: string;\n };\n build?: {\n os?: string;\n arch?: string;\n };\n}\n\ninterface BunGlobal {\n version: string;\n}\n\ndeclare const Deno: DenoGlobal | undefined;\ndeclare const Bun: BunGlobal | undefined;\ndeclare const EdgeRuntime: string | undefined;\ndeclare const self: typeof globalThis.self & {\n importScripts?: unknown;\n};\n\n/**\n * A constant that indicates which environment and version the SDK is running in.\n */\nexport const RUNTIME: Runtime = evaluateRuntime();\n\nexport interface Runtime {\n type: \"browser\" | \"web-worker\" | \"deno\" | \"bun\" | \"node\" | \"react-native\" | \"unknown\" | \"workerd\" | \"edge-runtime\";\n version?: string;\n parsedVersion?: number;\n /**\n * The operating system the SDK is running on, when it can be determined\n * (e.g. \"linux\", \"darwin\", \"win32\" on server runtimes). Undefined in\n * environments where the OS is not observable (e.g. browsers).\n */\n os?: string;\n /**\n * The CPU architecture the SDK is running on, when it can be determined\n * (e.g. \"x64\", \"arm64\" on server runtimes). Undefined in environments where\n * the architecture is not observable (e.g. browsers).\n */\n arch?: string;\n}\n\nfunction evaluateRuntime(): Runtime {\n /**\n * A constant that indicates whether the environment the code is running is a Web Browser.\n */\n const isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\";\n if (isBrowser) {\n return {\n type: \"browser\",\n version: window.navigator.userAgent,\n };\n }\n\n /**\n * A constant that indicates whether the environment the code is running is Cloudflare.\n * https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent\n */\n const isCloudflare = typeof globalThis !== \"undefined\" && globalThis?.navigator?.userAgent === \"Cloudflare-Workers\";\n if (isCloudflare) {\n return {\n type: \"workerd\",\n };\n }\n\n /**\n * A constant that indicates whether the environment the code is running is Edge Runtime.\n * https://vercel.com/docs/functions/runtimes/edge-runtime#check-if-you're-running-on-the-edge-runtime\n */\n const isEdgeRuntime = typeof EdgeRuntime === \"string\";\n if (isEdgeRuntime) {\n return {\n type: \"edge-runtime\",\n };\n }\n\n /**\n * A constant that indicates whether the environment the code is running is a Web Worker.\n */\n const isWebWorker =\n typeof self === \"object\" &&\n typeof self?.importScripts === \"function\" &&\n (self.constructor?.name === \"DedicatedWorkerGlobalScope\" ||\n self.constructor?.name === \"ServiceWorkerGlobalScope\" ||\n self.constructor?.name === \"SharedWorkerGlobalScope\");\n if (isWebWorker) {\n return {\n type: \"web-worker\",\n };\n }\n\n /**\n * A constant that indicates whether the environment the code is running is Deno.\n * FYI Deno spoofs process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions\n */\n const isDeno =\n typeof Deno !== \"undefined\" && typeof Deno.version !== \"undefined\" && typeof Deno.version.deno !== \"undefined\";\n if (isDeno) {\n return {\n type: \"deno\",\n version: Deno.version.deno,\n os: Deno.build?.os,\n arch: Deno.build?.arch,\n };\n }\n\n /**\n * A constant that indicates whether the environment the code is running is Bun.sh.\n */\n const isBun = typeof Bun !== \"undefined\" && typeof Bun.version !== \"undefined\";\n if (isBun) {\n return {\n type: \"bun\",\n version: Bun.version,\n os: typeof process !== \"undefined\" ? process.platform : undefined,\n arch: typeof process !== \"undefined\" ? process.arch : undefined,\n };\n }\n\n /**\n * A constant that indicates whether the environment the code is running is in React-Native.\n * This check should come before Node.js detection since React Native may have a process polyfill.\n * https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js\n */\n const isReactNative = typeof navigator !== \"undefined\" && navigator?.product === \"ReactNative\";\n if (isReactNative) {\n return {\n type: \"react-native\",\n };\n }\n\n /**\n * A constant that indicates whether the environment the code is running is Node.JS.\n *\n * We assign `process` to a local variable first to avoid being flagged by\n * bundlers that perform static analysis on `process.versions` (e.g. Next.js\n * Edge Runtime warns about Node.js APIs even when they are guarded).\n */\n const _process = typeof process !== \"undefined\" ? process : undefined;\n const isNode = typeof _process !== \"undefined\" && typeof _process.versions?.node === \"string\";\n if (isNode) {\n return {\n type: \"node\",\n version: _process.versions.node,\n parsedVersion: Number(_process.versions.node.split(\".\")[0]),\n os: _process.platform,\n arch: _process.arch,\n };\n }\n\n return {\n type: \"unknown\",\n };\n}\n\n/**\n * Display names for the language runtimes whose version is meaningful to encode\n * in a User-Agent. Environments where a version string is not useful (e.g.\n * browsers, where `version` is the full navigator UA) are intentionally mapped\n * to `undefined` so they are omitted from the User-Agent.\n */\nconst RUNTIME_DISPLAY_NAMES: Record<Runtime[\"type\"], string | undefined> = {\n node: \"Node\",\n deno: \"Deno\",\n bun: \"Bun\",\n browser: undefined,\n \"web-worker\": undefined,\n \"react-native\": undefined,\n workerd: undefined,\n \"edge-runtime\": undefined,\n unknown: undefined,\n};\n\n/**\n * CPU architecture aliases that all refer to 64-bit x86. They are normalized to\n * the single canonical token `x86_64` so the User-Agent architecture label is\n * consistent regardless of which runtime reports it (Node reports `x64`, others\n * report `amd64` or `x86_64`).\n */\nconst X86_64_ARCH_ALIASES = new Set([\"x64\", \"amd64\", \"x86_64\"]);\n\n/**\n * Normalizes a CPU architecture token, collapsing the 64-bit x86 aliases\n * (`x64`, `amd64`, `x86_64`) to `x86_64`. Other architectures are returned\n * unchanged.\n */\nfunction normalizeArch(arch: string | undefined): string | undefined {\n if (arch == null) {\n return arch;\n }\n return X86_64_ARCH_ALIASES.has(arch.toLowerCase()) ? \"x86_64\" : arch;\n}\n\n/**\n * Percent-encodes the `@` and `/` characters in an npm package name so the\n * User-Agent product token stays within the RFC 7230 token grammar. The\n * original scoped package name can be recovered by URL-decoding (e.g.\n * `@dummy/sdk` becomes `%40dummy%2Fsdk`).\n */\nfunction encodeProductName(sdkName: string): string {\n return sdkName.replace(/@/g, \"%40\").replace(/\\//g, \"%2F\");\n}\n\n/**\n * Builds a structured User-Agent string of the form\n * `{sdkName}/{sdkVersion} ({os}; {arch}) {runtime}/{runtimeVersion}`\n * where the platform group and runtime segment are omitted gracefully when the\n * underlying values cannot be determined (e.g. in a browser).\n */\nexport function getUserAgent(sdkName: string, sdkVersion: string): string {\n let userAgent = `${encodeProductName(sdkName)}/${sdkVersion}`;\n\n const platform = [RUNTIME.os, normalizeArch(RUNTIME.arch)].filter(\n (part): part is string => part != null && part.length > 0,\n );\n if (platform.length > 0) {\n userAgent += ` (${platform.join(\"; \")})`;\n }\n\n const runtimeName = RUNTIME_DISPLAY_NAMES[RUNTIME.type];\n if (runtimeName != null) {\n userAgent += ` ${runtimeName}`;\n if (RUNTIME.version != null && RUNTIME.version.length > 0) {\n userAgent += `/${RUNTIME.version}`;\n }\n }\n\n return userAgent;\n}\n", "import { toMultipartDataPart, type Uploadable } from \"../../core/file/index.js\";\nimport { toJson } from \"../../core/json.js\";\nimport { RUNTIME } from \"../runtime/index.js\";\n\ninterface FormDataRequest<Body> {\n body: Body;\n headers: Record<string, string>;\n duplex?: \"half\";\n}\n\nexport async function newFormData(): Promise<FormDataWrapper> {\n return new FormDataWrapper();\n}\n\nexport class FormDataWrapper {\n private fd: FormData = new FormData();\n\n public async setup(): Promise<void> {\n // noop\n }\n\n public append(key: string, value: unknown): void {\n this.fd.append(key, String(value));\n }\n\n public async appendFile(key: string, value: Uploadable): Promise<void> {\n if (value == null) {\n throw new Error(\n `File upload for \"${key}\" received ${value === null ? \"null\" : \"undefined\"}. The generated code should not call appendFile with null/undefined \u2014 check that optional file fields are guarded before this call.`,\n );\n }\n const { data, filename, contentType } = await toMultipartDataPart(value);\n const blob = await convertToBlob(data, contentType);\n if (filename) {\n this.fd.append(key, blob, filename);\n } else {\n this.fd.append(key, blob);\n }\n }\n\n public getRequest(): FormDataRequest<FormData> {\n return {\n body: this.fd,\n headers: {},\n duplex: \"half\" as const,\n };\n }\n}\n\ntype StreamLike = {\n read?: () => unknown;\n pipe?: (dest: unknown) => unknown;\n} & unknown;\n\nfunction isStreamLike(value: unknown): value is StreamLike {\n return typeof value === \"object\" && value != null && (\"read\" in value || \"pipe\" in value);\n}\n\nfunction isReadableStream(value: unknown): value is ReadableStream {\n return typeof value === \"object\" && value != null && \"getReader\" in value;\n}\n\nfunction isBuffer(value: unknown): value is Buffer {\n return typeof Buffer !== \"undefined\" && Buffer.isBuffer && Buffer.isBuffer(value);\n}\n\nfunction isArrayBufferView(value: unknown): value is ArrayBufferView {\n return ArrayBuffer.isView(value);\n}\n\nasync function streamToBuffer(stream: unknown): Promise<Buffer> {\n if (RUNTIME.type === \"node\") {\n const { Readable } = await import(\"stream\");\n\n if (stream instanceof Readable) {\n const chunks: Buffer[] = [];\n for await (const chunk of stream) {\n chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));\n }\n return Buffer.concat(chunks);\n }\n }\n\n if (isReadableStream(stream)) {\n const reader = stream.getReader();\n const chunks: Uint8Array[] = [];\n\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n chunks.push(value);\n }\n } finally {\n reader.releaseLock();\n }\n\n const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0);\n const result = new Uint8Array(totalLength);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.length;\n }\n\n return Buffer.from(result);\n }\n\n throw new Error(\n `Unsupported stream type: ${typeof stream}. Expected Node.js Readable stream or Web ReadableStream.`,\n );\n}\n\nasync function convertToBlob(value: unknown, contentType?: string): Promise<Blob> {\n if (isStreamLike(value) || isReadableStream(value)) {\n const buffer = await streamToBuffer(value);\n return new Blob([buffer as BlobPart], { type: contentType });\n }\n\n if (value instanceof Blob) {\n return value;\n }\n\n if (isBuffer(value)) {\n return new Blob([value as BlobPart], { type: contentType });\n }\n\n if (value instanceof ArrayBuffer) {\n return new Blob([value], { type: contentType });\n }\n\n if (isArrayBufferView(value)) {\n return new Blob([value as BlobPart], { type: contentType });\n }\n\n if (typeof value === \"string\") {\n return new Blob([value], { type: contentType });\n }\n\n if (typeof value === \"object\" && value !== null) {\n return new Blob([toJson(value)], { type: contentType ?? \"application/json\" });\n }\n\n return new Blob([String(value)], { type: contentType });\n}\n", "export * from \"./logger.js\";\n", "import type { HttpResponsePromise, RawResponse } from \"../fetcher/index.js\";\n\n/**\n * A page of results from a paginated API.\n *\n * @template T The type of the items in the page.\n * @template R The type of the API response.\n */\nexport class Page<T, R = unknown> implements AsyncIterable<T> {\n public data: T[];\n public rawResponse: RawResponse;\n public response: R;\n\n private _hasNextPage: (response: R) => boolean;\n private getItems: (response: R) => T[];\n private loadNextPage: (response: R) => HttpResponsePromise<R>;\n\n constructor({\n response,\n rawResponse,\n hasNextPage,\n getItems,\n loadPage,\n }: {\n response: R;\n rawResponse: RawResponse;\n hasNextPage: (response: R) => boolean;\n getItems: (response: R) => T[];\n loadPage: (response: R) => HttpResponsePromise<R>;\n }) {\n this.response = response;\n this.rawResponse = rawResponse;\n this.data = getItems(response);\n this._hasNextPage = hasNextPage;\n this.getItems = getItems;\n this.loadNextPage = loadPage;\n }\n\n /**\n * Retrieves the next page\n * @returns this\n */\n public async getNextPage(): Promise<this> {\n const { data, rawResponse } = await this.loadNextPage(this.response).withRawResponse();\n this.response = data;\n this.rawResponse = rawResponse;\n this.data = this.getItems(this.response);\n return this;\n }\n\n /**\n * @returns whether there is a next page to load\n */\n public hasNextPage(): boolean {\n return this._hasNextPage(this.response);\n }\n\n private async *iterMessages(): AsyncGenerator<T, void> {\n for (const item of this.data) {\n yield item;\n }\n\n while (this.hasNextPage()) {\n await this.getNextPage();\n for (const item of this.data) {\n yield item;\n }\n }\n }\n\n async *[Symbol.asyncIterator](): AsyncIterator<T, void, unknown> {\n for await (const message of this.iterMessages()) {\n yield message;\n }\n }\n}\n", "import { fromJson } from \"../json.js\";\nimport { RUNTIME } from \"../runtime/index.js\";\n\nexport declare namespace Stream {\n interface Args {\n /**\n * The HTTP response stream to read from.\n */\n\n stream: ReadableStream;\n\n /**\n * The event shape to use for parsing the stream data.\n */\n eventShape: JsonEvent | SseEvent;\n /**\n * An abort signal to stop the stream.\n */\n signal?: AbortSignal;\n /**\n * Whether transparent mid-stream reconnection is enabled on resumable\n * SSE endpoints. Defaults to true. Has no effect on non-resumable endpoints.\n */\n reconnectionEnabled?: boolean;\n /**\n * Maximum number of consecutive failed reconnect attempts on resumable SSE\n * endpoints before giving up. The counter resets to zero each time a\n * reconnected stream successfully yields at least one event (i.e. makes\n * progress). Has no effect on non-resumable endpoints.\n */\n maxReconnectionAttempts?: number;\n /**\n * A function that re-issues the HTTP request with the Last-Event-ID header\n * and returns the new response body stream. Required for reconnection to work.\n */\n\n reconnect?: (lastEventId: string) => Promise<ReadableStream>;\n }\n\n interface JsonEvent {\n type: \"json\";\n messageTerminator: string;\n }\n\n interface SseEvent {\n type: \"sse\";\n streamTerminator?: string;\n eventDiscriminator?: string;\n /** Event names whose union variant wraps the `data:` payload as `{ <eventDiscriminator>, data }`. */\n envelopeEvents?: string[];\n resumable?: boolean;\n }\n}\n\nexport interface ServerSentEvent<T> {\n data: T;\n id?: string;\n retry?: number;\n event?: string;\n}\n\nconst DATA_PREFIX = \"data:\";\nconst EVENT_PREFIX = \"event:\";\nconst ID_PREFIX = \"id:\";\nconst RETRY_PREFIX = \"retry:\";\n\nconst DEFAULT_MAX_RECONNECTION_ATTEMPTS = 5;\nconst DEFAULT_RECONNECT_DELAY_MS = 1_000;\nconst MAX_RECONNECT_DELAY_MS = 30_000;\n\nexport class Stream<T> implements AsyncIterable<T> {\n private stream: ReadableStream;\n\n private parse: (val: unknown) => Promise<T>;\n /**\n * The prefix to use for each message. For example,\n * for SSE, the prefix is \"data: \".\n */\n private prefix: string | undefined;\n private messageTerminator: string;\n private streamTerminator: string | undefined;\n private eventDiscriminator: string | undefined;\n private envelopeEvents: Set<string> | undefined;\n private resumable: boolean;\n private reconnectionEnabled: boolean;\n private maxReconnectionAttempts: number;\n\n private reconnect: ((lastEventId: string) => Promise<ReadableStream>) | undefined;\n\n private controller: AbortController = new AbortController();\n private decoder: TextDecoder | undefined;\n private externalSignal: AbortSignal | undefined;\n private onExternalAbort: (() => void) | undefined;\n\n constructor({\n stream,\n parse,\n eventShape,\n signal,\n reconnectionEnabled,\n maxReconnectionAttempts,\n reconnect,\n }: Stream.Args & { parse: (val: unknown) => Promise<T> }) {\n this.stream = stream;\n this.parse = parse;\n if (eventShape.type === \"sse\") {\n this.prefix = DATA_PREFIX;\n this.messageTerminator = \"\\n\";\n this.streamTerminator = eventShape.streamTerminator;\n this.eventDiscriminator = eventShape.eventDiscriminator;\n this.envelopeEvents = eventShape.envelopeEvents != null ? new Set(eventShape.envelopeEvents) : undefined;\n this.resumable = eventShape.resumable ?? false;\n } else {\n this.messageTerminator = eventShape.messageTerminator;\n this.resumable = false;\n }\n this.reconnectionEnabled = reconnectionEnabled ?? true;\n this.maxReconnectionAttempts = maxReconnectionAttempts ?? DEFAULT_MAX_RECONNECTION_ATTEMPTS;\n this.reconnect = reconnect;\n if (signal != null) {\n this.externalSignal = signal;\n this.onExternalAbort = () => this.controller.abort();\n signal.addEventListener(\"abort\", this.onExternalAbort, { once: true });\n }\n\n // Initialize shared TextDecoder\n if (typeof TextDecoder !== \"undefined\") {\n this.decoder = new TextDecoder(\"utf-8\");\n }\n }\n\n private async *iterMessages(): AsyncGenerator<ServerSentEvent<T>, void> {\n if (this.eventDiscriminator != null) {\n yield* this.iterSseEvents();\n } else {\n yield* this.iterDataMessages();\n }\n }\n\n private async *iterDataMessages(): AsyncGenerator<ServerSentEvent<T>, void> {\n let reconnectAttempts = 0;\n let currentStream = this.stream;\n let lastId: string | undefined;\n // The id of the most recently *dispatched* event. Per the WHATWG\n // EventSource spec, the \"last event ID\" is only committed when an event\n // is dispatched, not when the `id:` line is parsed. Reconnecting with a\n // parsed-but-undispatched id would skip an event that was never yielded\n // (e.g. if the connection drops after `id:` but before the event's\n // terminating blank line), so reconnection uses lastDispatchedId.\n let lastDispatchedId: string | undefined;\n let lastRetry: number | undefined;\n\n while (true) {\n const stream = readableStreamAsyncIterable<any>(currentStream);\n let buf = \"\";\n let dataValue: string | undefined;\n\n for await (const chunk of stream) {\n buf += this.decodeChunk(chunk);\n\n let terminatorIndex: number;\n while ((terminatorIndex = buf.indexOf(this.messageTerminator)) >= 0) {\n const line = buf.slice(0, terminatorIndex);\n buf = buf.slice(terminatorIndex + this.messageTerminator.length);\n\n if (!line.trim()) {\n if (this.prefix != null && dataValue != null) {\n if (this.streamTerminator != null && dataValue.includes(this.streamTerminator)) {\n return;\n }\n const data = await this.parse(fromJson(dataValue));\n yield { data, id: lastId, retry: lastRetry, event: undefined };\n lastDispatchedId = lastId;\n reconnectAttempts = 0;\n dataValue = undefined;\n }\n continue;\n }\n\n if (line.startsWith(ID_PREFIX)) {\n const idValue = line.slice(ID_PREFIX.length).trim();\n if (!idValue.includes(\"\\0\")) {\n lastId = idValue;\n }\n continue;\n }\n if (line.startsWith(RETRY_PREFIX)) {\n const retryValue = line.slice(RETRY_PREFIX.length).trim();\n const parsed = parseInt(retryValue, 10);\n if (!Number.isNaN(parsed) && String(parsed) === retryValue) {\n lastRetry = parsed;\n }\n continue;\n }\n\n if (this.prefix != null) {\n const prefixIndex = line.indexOf(this.prefix);\n if (prefixIndex === -1) {\n continue;\n }\n const val = line.slice(prefixIndex + this.prefix.length).trim();\n dataValue = dataValue != null ? `${dataValue}\\n${val}` : val;\n } else {\n if (this.streamTerminator != null && line.includes(this.streamTerminator)) {\n return;\n }\n const data = await this.parse(fromJson(line));\n yield { data, id: lastId, retry: lastRetry, event: undefined };\n lastDispatchedId = lastId;\n reconnectAttempts = 0;\n }\n }\n }\n\n if (this.prefix != null && dataValue != null) {\n if (this.streamTerminator != null && dataValue.includes(this.streamTerminator)) {\n return;\n }\n const data = await this.parse(fromJson(dataValue));\n yield { data, id: lastId, retry: lastRetry, event: undefined };\n lastDispatchedId = lastId;\n reconnectAttempts = 0;\n }\n\n if (!this.shouldReconnect(lastDispatchedId, reconnectAttempts)) {\n return;\n }\n\n reconnectAttempts++;\n await this.delayReconnect(lastRetry);\n if (this.controller.signal.aborted) {\n return;\n }\n // Re-check after async delay; needed for TypeScript narrowing.\n const reconnectFn = this.reconnect;\n if (reconnectFn == null || lastDispatchedId == null) {\n return;\n }\n try {\n const reconnected = await reconnectFn(lastDispatchedId);\n if (reconnected == null) {\n currentStream = this.createEmptyStream();\n continue;\n }\n currentStream = reconnected;\n } catch {\n // Failed reconnect (e.g. HTTP error); assign an empty stream\n // so the next iteration is a safe no-op before shouldReconnect.\n currentStream = this.createEmptyStream();\n }\n }\n }\n\n private async *iterSseEvents(): AsyncGenerator<ServerSentEvent<T>, void> {\n let reconnectAttempts = 0;\n let currentStream = this.stream;\n let lastId: string | undefined;\n // See iterDataMessages: reconnection uses the last *dispatched* id (per\n // the EventSource spec), not the last *parsed* id, to avoid skipping an\n // event that was never yielded when a drop lands mid-event.\n let lastDispatchedId: string | undefined;\n let lastRetry: number | undefined;\n\n while (true) {\n const stream = readableStreamAsyncIterable<any>(currentStream);\n let buf = \"\";\n let eventType: string | undefined;\n let dataValue: string | undefined;\n\n for await (const chunk of stream) {\n buf += this.decodeChunk(chunk);\n\n let terminatorIndex: number;\n while ((terminatorIndex = buf.indexOf(\"\\n\")) >= 0) {\n const line = buf.slice(0, terminatorIndex).replace(/\\r$/, \"\");\n buf = buf.slice(terminatorIndex + 1);\n\n if (!line.trim()) {\n if (dataValue != null) {\n const data = await this.dispatchSseEvent(dataValue, eventType);\n if (data == null) {\n return;\n }\n yield { data, id: lastId, retry: lastRetry, event: eventType };\n lastDispatchedId = lastId;\n reconnectAttempts = 0;\n }\n eventType = undefined;\n dataValue = undefined;\n continue;\n }\n\n if (line.startsWith(EVENT_PREFIX)) {\n eventType = line.slice(EVENT_PREFIX.length).trim();\n } else if (line.startsWith(DATA_PREFIX)) {\n const val = line.slice(DATA_PREFIX.length).trim();\n dataValue = dataValue != null ? `${dataValue}\\n${val}` : val;\n } else if (line.startsWith(ID_PREFIX)) {\n const idValue = line.slice(ID_PREFIX.length).trim();\n if (!idValue.includes(\"\\0\")) {\n lastId = idValue;\n }\n } else if (line.startsWith(RETRY_PREFIX)) {\n const retryValue = line.slice(RETRY_PREFIX.length).trim();\n const parsed = parseInt(retryValue, 10);\n if (!Number.isNaN(parsed) && String(parsed) === retryValue) {\n lastRetry = parsed;\n }\n }\n }\n }\n\n if (dataValue != null) {\n const data = await this.dispatchSseEvent(dataValue, eventType);\n if (data != null) {\n yield { data, id: lastId, retry: lastRetry, event: eventType };\n lastDispatchedId = lastId;\n reconnectAttempts = 0;\n }\n }\n\n if (!this.shouldReconnect(lastDispatchedId, reconnectAttempts)) {\n return;\n }\n\n reconnectAttempts++;\n await this.delayReconnect(lastRetry);\n if (this.controller.signal.aborted) {\n return;\n }\n // Re-check after async delay; needed for TypeScript narrowing.\n const reconnectFn = this.reconnect;\n if (reconnectFn == null || lastDispatchedId == null) {\n return;\n }\n try {\n const reconnected = await reconnectFn(lastDispatchedId);\n if (reconnected == null) {\n currentStream = this.createEmptyStream();\n continue;\n }\n currentStream = reconnected;\n } catch {\n // Failed reconnect (e.g. HTTP error); assign an empty stream\n // so the next iteration is a safe no-op before shouldReconnect.\n currentStream = this.createEmptyStream();\n }\n }\n }\n\n /**\n * Parses and returns a single SSE event, or returns null if the event is a stream terminator.\n */\n private async dispatchSseEvent(dataValue: string, eventType: string | undefined): Promise<T | null> {\n if (this.streamTerminator != null && dataValue.includes(this.streamTerminator)) {\n return null;\n }\n return this.parse(this.injectDiscriminator(fromJson(dataValue), eventType));\n }\n\n /**\n * Determines whether a reconnection attempt should be made.\n */\n private shouldReconnect(lastId: string | undefined, reconnectAttempts: number): boolean {\n if (!this.resumable) {\n return false;\n }\n if (this.streamTerminator == null) {\n // Without a terminator the client cannot distinguish a completed\n // stream from a dropped connection, so reconnection is disabled.\n return false;\n }\n // NOTE: When a terminator IS configured but the server never sends it\n // (e.g. it drops the connection after emitting events every time),\n // maxReconnectionAttempts is a per-consecutive-failure cap \u2014 each\n // yielded event resets the counter. This matches EventSource semantics\n // but means such a server can cause unbounded reconnections. Callers\n // concerned about this should impose a wall-clock budget externally.\n if (!this.reconnectionEnabled) {\n return false;\n }\n if (this.reconnect == null) {\n return false;\n }\n if (lastId == null || lastId === \"\") {\n return false;\n }\n if (reconnectAttempts >= this.maxReconnectionAttempts) {\n return false;\n }\n if (this.controller.signal.aborted) {\n return false;\n }\n return true;\n }\n\n /**\n * Delays before reconnecting, using a server-sent retry directive if provided\n * (clamped to MAX_RECONNECT_DELAY_MS), otherwise falling back to\n * DEFAULT_RECONNECT_DELAY_MS. The delay is abortable: if the stream's abort\n * signal fires during the wait, the promise resolves immediately.\n */\n private async delayReconnect(lastRetry: number | undefined): Promise<void> {\n const base = lastRetry != null && lastRetry > 0 ? lastRetry : DEFAULT_RECONNECT_DELAY_MS;\n const delay = Math.min(base, MAX_RECONNECT_DELAY_MS);\n const signal = this.controller.signal;\n if (signal.aborted) {\n return;\n }\n await new Promise<void>((resolve) => {\n const timer = setTimeout(() => {\n signal.removeEventListener(\"abort\", onAbort);\n resolve();\n }, delay);\n const onAbort = (): void => {\n clearTimeout(timer);\n resolve();\n };\n signal.addEventListener(\"abort\", onAbort, { once: true });\n });\n }\n\n private createEmptyStream(): ReadableStream {\n return new ReadableStream({\n start(controller) {\n controller.close();\n },\n });\n }\n\n private removeAbortListener(): void {\n if (this.externalSignal != null && this.onExternalAbort != null) {\n this.externalSignal.removeEventListener(\"abort\", this.onExternalAbort);\n this.onExternalAbort = undefined;\n }\n }\n\n public withMetadata(): AsyncIterable<ServerSentEvent<T>> {\n const self = this;\n return {\n async *[Symbol.asyncIterator]() {\n try {\n yield* self.iterMessages();\n } finally {\n self.removeAbortListener();\n }\n },\n };\n }\n\n private injectDiscriminator(parsed: unknown, eventType: string | undefined): unknown {\n if (this.eventDiscriminator == null || eventType == null) {\n return parsed;\n }\n if (this.envelopeEvents?.has(eventType)) {\n return { [this.eventDiscriminator]: eventType, data: parsed };\n }\n if (parsed == null || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n return parsed;\n }\n const obj = parsed as Record<string, unknown>;\n if (this.eventDiscriminator in obj) {\n return parsed;\n }\n return { [this.eventDiscriminator]: eventType, ...obj };\n }\n\n async *[Symbol.asyncIterator](): AsyncIterator<T, void, unknown> {\n try {\n for await (const event of this.iterMessages()) {\n yield event.data;\n }\n } finally {\n this.removeAbortListener();\n }\n }\n\n private decodeChunk(chunk: any): string {\n let decoded = \"\";\n // If TextDecoder is available, use the streaming decoder instance\n if (this.decoder != null) {\n decoded += this.decoder.decode(chunk, { stream: true });\n }\n // Buffer is present in Node.js environment\n else if (RUNTIME.type === \"node\" && typeof chunk !== \"undefined\") {\n decoded += Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);\n }\n return decoded;\n }\n}\n\n/**\n * Browser polyfill for ReadableStream\n */\n// biome-ignore lint/suspicious/noExplicitAny: allow explicit any\nexport function readableStreamAsyncIterable<T>(stream: any): AsyncIterableIterator<T> {\n if (stream[Symbol.asyncIterator]) {\n return stream;\n }\n\n const reader = stream.getReader();\n return {\n async next() {\n try {\n const result = await reader.read();\n if (result?.done) {\n reader.releaseLock();\n } // release lock when stream becomes closed\n return result;\n } catch (e) {\n reader.releaseLock(); // release lock when stream becomes errored\n throw e;\n }\n },\n async return() {\n const cancelPromise = reader.cancel();\n reader.releaseLock();\n await cancelPromise;\n return { done: true, value: undefined };\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n };\n}\n", "export { encodePathParam } from \"./encodePathParam.js\";\nexport { join } from \"./join.js\";\nexport { queryBuilder } from \"./QueryStringBuilder.js\";\nexport { toQueryString } from \"./qs.js\";\n", "export function encodePathParam(\n param: unknown,\n InvalidPathParameterError?: new (args: { message: string }) => Error,\n): string {\n if (param === null) {\n return \"null\";\n }\n const typeofParam = typeof param;\n switch (typeofParam) {\n case \"undefined\":\n return \"undefined\";\n case \"string\":\n case \"number\":\n case \"boolean\":\n break;\n default:\n param = String(param);\n break;\n }\n const encoded = encodeURIComponent(param as string | number | boolean);\n // \".\" and \"..\" are dot segments: URL resolution would remove them and send the request to a different path.\n if (encoded === \".\" || encoded === \"..\") {\n const message = `Invalid path parameter \"${encoded}\": \".\" and \"..\" are not allowed because they change the request path.`;\n throw InvalidPathParameterError != null ? new InvalidPathParameterError({ message }) : new Error(message);\n }\n return encoded;\n}\n", "import { toQueryString } from \"./qs.js\";\n\n/**\n * Creates a fluent builder for constructing URL query strings.\n *\n * Each `.add()` call serializes its value immediately (like C#'s builder),\n * so no format tracking is needed \u2014 the style is applied at add-time.\n *\n * Usage (generated code):\n *\n * const qs = core.url.queryBuilder()\n * .add(\"limit\", limit)\n * .add(\"tags\", tags, { style: \"comma\" }) // explode: false\n * .mergeAdditional(requestOptions?.queryParams)\n * .build();\n */\nexport function queryBuilder(): QueryStringBuilder {\n return new QueryStringBuilder();\n}\n\nclass QueryStringBuilder {\n private parts: Map<string, string> = new Map();\n\n /**\n * Adds a query parameter, serializing it immediately.\n *\n * By default arrays use \"repeat\" format (`key=a&key=b`).\n * Pass `{ style: \"comma\" }` for OpenAPI `explode: false` parameters\n * to get comma-separated values (`key=a,b,c`).\n *\n * Null / undefined values are silently skipped.\n */\n add(key: string, value: unknown, options?: { style?: \"comma\" }): this {\n if (value === undefined || value === null) {\n return this;\n }\n const serialized = toQueryString(\n { [key]: value },\n { arrayFormat: options?.style === \"comma\" ? \"comma\" : \"repeat\" },\n );\n if (serialized.length > 0) {\n this.parts.set(key, serialized);\n }\n return this;\n }\n\n /**\n * Adds multiple query parameters at once from a record.\n * All parameters use the default \"repeat\" array format.\n * Null / undefined values are silently skipped.\n */\n addMany(params: Record<string, unknown>): this {\n if (params != null) {\n for (const [key, value] of Object.entries(params)) {\n this.add(key, value);\n }\n }\n return this;\n }\n\n /**\n * Merges additional query parameters supplied at call-time via\n * `requestOptions.queryParams`. Overrides existing keys (last-write-wins).\n */\n mergeAdditional(additionalParams?: Record<string, unknown>): this {\n if (additionalParams != null) {\n for (const [key, value] of Object.entries(additionalParams)) {\n if (value === undefined || value === null) {\n continue;\n }\n const serialized = toQueryString({ [key]: value }, { arrayFormat: \"repeat\" });\n if (serialized.length > 0) {\n this.parts.set(key, serialized);\n }\n }\n }\n return this;\n }\n\n /**\n * Returns the assembled query string (without the leading `?`).\n * Returns an empty string when no parameters were added.\n */\n build(): string {\n return [...this.parts.values()].join(\"&\");\n }\n}\n", "/**\n * Returns a copy of object with the value at path set. If a portion of path doesn\u2019t exist it\u2019s created.\n * Each object along path is shallow-copied, so the original object (and any nested objects it\n * shares with the copy) is never modified. This is inspired by Lodash's set function, but is\n * simplified to accommodate our use case. For more details, see https://lodash.com/docs/4.17.15#set.\n *\n * @param object The object to copy.\n * @param path The path of the property to set.\n * @param value The value to set.\n * @return Returns the updated copy of object.\n */\nexport function setObjectProperty<T extends object>(object: T, path: string, value: any): T {\n if (object == null) {\n return object;\n }\n\n const keys: string[] = path.split(\".\");\n if (keys.length === 0) {\n // Invalid path; do nothing.\n return object;\n }\n\n const result: Record<string, any> = { ...object };\n let current: Record<string, any> = result;\n for (let i = 0; i < keys.length - 1; i++) {\n const key = keys[i];\n if (key == null) {\n // Unreachable.\n continue;\n }\n const next = current[key];\n if (Array.isArray(next)) {\n current[key] = [...next];\n } else {\n current[key] = next != null && typeof next === \"object\" ? { ...next } : {};\n }\n current = current[key] as Record<string, any>;\n }\n\n const lastKey = keys[keys.length - 1];\n if (lastKey == null) {\n // Unreachable.\n return result as T;\n }\n\n current[lastKey] = value;\n return result as T;\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport * as core from \"../core/index.js\";\nimport * as errors from \"../errors/index.js\";\n\nconst TOKEN_PARAM = \"token\" as const;\n\nexport class BearerAuthProvider implements core.AuthProvider {\n private readonly options: BearerAuthProvider.Options;\n\n constructor(options: BearerAuthProvider.Options) {\n this.options = options;\n }\n\n public static canCreate(options: Partial<BearerAuthProvider.Options>): boolean {\n return options?.[TOKEN_PARAM] != null;\n }\n\n public async getAuthRequest({\n endpointMetadata,\n }: {\n endpointMetadata?: core.EndpointMetadata;\n } = {}): Promise<core.AuthRequest> {\n const token = await core.Supplier.get(this.options[TOKEN_PARAM]);\n if (token == null) {\n throw new errors.SmoothAgentApiError({\n message: BearerAuthProvider.AUTH_CONFIG_ERROR_MESSAGE,\n });\n }\n\n return {\n headers: { Authorization: `Bearer ${token}` },\n };\n }\n}\n\nexport namespace BearerAuthProvider {\n export const AUTH_SCHEME = \"ApiKeyAuth\" as const;\n export const AUTH_CONFIG_ERROR_MESSAGE: string =\n `Please provide '${TOKEN_PARAM}' when initializing the client` as const;\n export type Options = AuthOptions;\n export type AuthOptions = { [TOKEN_PARAM]: core.Supplier<core.BearerToken> };\n\n export function createInstance(options: Options): core.AuthProvider {\n return new BearerAuthProvider(options);\n }\n}\n", "export function mergeHeaders(...headersArray: (Record<string, unknown> | null | undefined)[]): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const [key, value] of headersArray\n .filter((headers) => headers != null)\n .flatMap((headers) => Object.entries(headers))) {\n const insensitiveKey = key.toLowerCase();\n if (value != null) {\n result[insensitiveKey] = value;\n } else if (insensitiveKey in result) {\n delete result[insensitiveKey];\n }\n }\n\n return result;\n}\n\nexport function mergeOnlyDefinedHeaders(\n ...headersArray: (Record<string, unknown> | null | undefined)[]\n): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const [key, value] of headersArray\n .filter((headers) => headers != null)\n .flatMap((headers) => Object.entries(headers))) {\n const insensitiveKey = key.toLowerCase();\n if (value != null) {\n result[insensitiveKey] = value;\n }\n }\n\n return result;\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport { BearerAuthProvider } from \"./auth/BearerAuthProvider.js\";\nimport { mergeHeaders } from \"./core/headers.js\";\nimport * as core from \"./core/index.js\";\nimport type * as environments from \"./environments.js\";\n\nexport type AuthOption =\n | false\n | core.AuthProvider[\"getAuthRequest\"]\n | core.AuthProvider\n | BearerAuthProvider.AuthOptions;\n\nexport type BaseClientOptions = {\n environment?: core.Supplier<environments.SmoothAgentApiEnvironment | string>;\n /** Specify a custom URL to connect the client to. */\n baseUrl?: core.Supplier<string>;\n /** Additional headers to include in requests. */\n headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;\n /** The default maximum time to wait for a response in seconds. */\n timeoutInSeconds?: number;\n /** The default number of times to retry the request. Defaults to 2. */\n maxRetries?: number;\n /** Provide a custom fetch implementation. Useful for platforms that don't have a built-in fetch or need a custom implementation. */\n fetch?: typeof fetch;\n /** Configure logging for the client. */\n logging?: core.logging.LogConfig | core.logging.Logger;\n /** Default options for SSE stream reconnection behavior. Has no effect on non-resumable endpoints. */\n stream?: { reconnectionEnabled?: boolean; maxReconnectionAttempts?: number };\n /** Override auth. Pass false to disable, a function returning auth headers, an AuthProvider, or auth options. */\n auth?: AuthOption;\n} & BearerAuthProvider.AuthOptions;\n\nexport interface BaseRequestOptions {\n /** The maximum time to wait for a response in seconds. */\n timeoutInSeconds?: number;\n /** The number of times to retry the request. Defaults to 2. */\n maxRetries?: number;\n /** A hook to abort the request. */\n abortSignal?: AbortSignal;\n /** Additional query string parameters to include in the request. */\n queryParams?: Record<string, unknown>;\n /** A dictionary containing additional parameters to spread into the request's body. */\n additionalBodyParameters?: Record<string, unknown>;\n /** Additional headers to include in the request. */\n headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;\n /** Options for SSE stream reconnection behavior. Has no effect on non-resumable endpoints. */\n stream?: { reconnectionEnabled?: boolean; maxReconnectionAttempts?: number };\n}\n\nexport type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {\n logging: core.logging.Logger;\n authProvider?: core.AuthProvider;\n};\n\nexport type NormalizedClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions> =\n NormalizedClientOptions<T> & {\n authProvider: core.AuthProvider;\n };\n\nexport function normalizeClientOptions<T extends BaseClientOptions = BaseClientOptions>(\n options: T,\n): NormalizedClientOptions<T> {\n const headers = mergeHeaders(\n {\n \"X-Fern-Language\": \"JavaScript\",\n \"X-Fern-Runtime\": core.RUNTIME.type,\n \"X-Fern-Runtime-Version\": core.RUNTIME.version,\n },\n options?.headers,\n );\n\n return {\n ...options,\n logging: core.logging.createLogger(options?.logging),\n headers,\n } as NormalizedClientOptions<T>;\n}\n\nexport function normalizeClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions>(\n options: T,\n): NormalizedClientOptionsWithAuth<T> {\n const normalized = normalizeClientOptions(options) as NormalizedClientOptionsWithAuth<T>;\n\n if (options.auth === false) {\n normalized.authProvider = new core.NoOpAuthProvider();\n return normalized;\n }\n if (options.auth != null) {\n if (typeof options.auth === \"function\") {\n normalized.authProvider = { getAuthRequest: options.auth };\n return normalized;\n }\n if (core.isAuthProvider(options.auth)) {\n normalized.authProvider = options.auth;\n return normalized;\n }\n Object.assign(normalized, options.auth);\n }\n\n const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);\n normalized.authProvider ??= new BearerAuthProvider(normalizedWithNoOpAuthProvider);\n return normalized;\n}\n\nfunction withNoOpAuthProvider<T extends BaseClientOptions = BaseClientOptions>(\n options: NormalizedClientOptions<T>,\n): NormalizedClientOptionsWithAuth<T> {\n return {\n ...options,\n authProvider: new core.NoOpAuthProvider(),\n };\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nexport const SmoothAgentApiEnvironment = {\n Default: \"https://smoothagent-v3-api.uaibuilder.workers.dev/v3\",\n} as const;\n\nexport type SmoothAgentApiEnvironment = typeof SmoothAgentApiEnvironment.Default;\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type * as core from \"../core/index.js\";\nimport * as errors from \"./index.js\";\n\nexport function handleNonStatusCodeError(\n error: core.Fetcher.Error,\n rawResponse: core.RawResponse,\n method: string,\n path: string,\n): never {\n switch (error.reason) {\n case \"non-json\":\n throw new errors.SmoothAgentApiError({\n statusCode: error.statusCode,\n body: error.rawBody,\n rawResponse: rawResponse,\n });\n case \"body-is-null\":\n throw new errors.SmoothAgentApiError({\n statusCode: error.statusCode,\n rawResponse: rawResponse,\n });\n case \"timeout\":\n throw new errors.SmoothAgentApiTimeoutError(`Timeout exceeded when calling ${method} ${path}.`, {\n cause: error.cause,\n });\n case \"unknown\":\n throw new errors.SmoothAgentApiError({\n message: error.errorMessage,\n rawResponse: rawResponse,\n cause: error.cause,\n });\n default:\n throw new errors.SmoothAgentApiError({\n message: \"Unknown error\",\n rawResponse: rawResponse,\n });\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type { BaseClientOptions, BaseRequestOptions } from \"../../../../BaseClient.js\";\nimport { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from \"../../../../BaseClient.js\";\nimport { mergeHeaders, mergeOnlyDefinedHeaders } from \"../../../../core/headers.js\";\nimport * as core from \"../../../../core/index.js\";\nimport * as environments from \"../../../../environments.js\";\nimport { handleNonStatusCodeError } from \"../../../../errors/handleNonStatusCodeError.js\";\nimport * as errors from \"../../../../errors/index.js\";\nimport * as SmoothAgentApi from \"../../../index.js\";\n\nexport declare namespace AgentsClient {\n export type Options = BaseClientOptions;\n\n export interface RequestOptions extends BaseRequestOptions {}\n}\n\nexport class AgentsClient {\n protected readonly _options: NormalizedClientOptionsWithAuth<AgentsClient.Options>;\n\n constructor(options: AgentsClient.Options) {\n this._options = normalizeClientOptionsWithAuth(options);\n }\n\n /**\n * Chave: todos do workspace (ou o recorte da chave restrita). Usu\u00E1rio: os que pode usar (`AgentPublic`).\n *\n * @param {SmoothAgentApi.AgentsListRequest} request\n * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.agents.list()\n */\n public async list(\n request: SmoothAgentApi.AgentsListRequest = {},\n requestOptions?: AgentsClient.RequestOptions,\n ): Promise<core.Page<SmoothAgentApi.AgentsListResponse.Data.Item, SmoothAgentApi.AgentsListResponse>> {\n const list = core.HttpResponsePromise.interceptFunction(\n async (\n request: SmoothAgentApi.AgentsListRequest,\n ): Promise<core.WithRawResponse<SmoothAgentApi.AgentsListResponse>> => {\n const { limit, cursor, \"SmoothAgent-Workspace\": smoothAgentWorkspace } = request;\n const _queryParams: Record<string, unknown> = {\n limit,\n cursor,\n };\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-Workspace\": smoothAgentWorkspace }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n \"agents\",\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url\n .queryBuilder()\n .addMany(_queryParams)\n .add(\"limit\", _queryParams.limit, { style: \"comma\" })\n .add(\"cursor\", _queryParams.cursor, { style: \"comma\" })\n .mergeAdditional(requestOptions?.queryParams)\n .build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return {\n data: _response.body as SmoothAgentApi.AgentsListResponse,\n rawResponse: _response.rawResponse,\n };\n }\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/agents\");\n },\n );\n const dataWithRawResponse = await list(request).withRawResponse();\n return new core.Page<SmoothAgentApi.AgentsListResponse.Data.Item, SmoothAgentApi.AgentsListResponse>({\n response: dataWithRawResponse.data,\n rawResponse: dataWithRawResponse.rawResponse,\n hasNextPage: (response) =>\n response?.nextCursor != null &&\n !(typeof response?.nextCursor === \"string\" && response?.nextCursor === \"\"),\n getItems: (response) => response?.data ?? [],\n loadPage: (response) => {\n return list(core.setObjectProperty(request, \"cursor\", response?.nextCursor));\n },\n });\n }\n\n /**\n * @param {SmoothAgentApi.AgentsGetRequest} request\n * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.agents.get({\n * id: \"id\"\n * })\n */\n public get(\n request: SmoothAgentApi.AgentsGetRequest,\n requestOptions?: AgentsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.AgentsGetResponse> {\n return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));\n }\n\n private async __get(\n request: SmoothAgentApi.AgentsGetRequest,\n requestOptions?: AgentsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.AgentsGetResponse>> {\n const { id } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `agents/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.AgentsGetResponse, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/agents/{id}\");\n }\n}\n", "/**\n * Spreads caller-supplied `additionalBodyParameters` (from `requestOptions.additionalBodyParameters`)\n * on top of the request body. Caller-supplied properties win over the endpoint body. When no\n * additional body parameters are provided, the original body is returned unchanged so serialization\n * is unaffected.\n *\n * The merge only applies to plain-object (JSON object) bodies. When the body is `null`/`undefined`\n * the additional parameters become the body; when the body is an array or a primitive JSON value it\n * is returned unchanged, since object properties cannot be spread into it. This mirrors the Python\n * SDK, which only merges additional body parameters into mapping bodies.\n */\nexport function mergeAdditionalBodyParameters(\n body: unknown,\n additionalBodyParameters: Record<string, unknown> | undefined,\n): unknown {\n if (additionalBodyParameters == null) {\n return body;\n }\n if (body == null) {\n return { ...additionalBodyParameters };\n }\n if (typeof body === \"object\" && !Array.isArray(body)) {\n return { ...body, ...additionalBodyParameters };\n }\n return body;\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type { BaseClientOptions, BaseRequestOptions } from \"../../../../BaseClient.js\";\nimport { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from \"../../../../BaseClient.js\";\nimport { mergeHeaders, mergeOnlyDefinedHeaders } from \"../../../../core/headers.js\";\nimport * as core from \"../../../../core/index.js\";\nimport { mergeAdditionalBodyParameters } from \"../../../../core/requestBody.js\";\nimport * as environments from \"../../../../environments.js\";\nimport { handleNonStatusCodeError } from \"../../../../errors/handleNonStatusCodeError.js\";\nimport * as errors from \"../../../../errors/index.js\";\nimport * as SmoothAgentApi from \"../../../index.js\";\n\nexport declare namespace ChatsClient {\n export type Options = BaseClientOptions;\n\n export interface RequestOptions extends BaseRequestOptions {}\n}\n\nexport class ChatsClient {\n protected readonly _options: NormalizedClientOptionsWithAuth<ChatsClient.Options>;\n\n constructor(options: ChatsClient.Options) {\n this._options = normalizeClientOptionsWithAuth(options);\n }\n\n /**\n * Ordenada por `updatedAt` desc (a lateral). Usu\u00E1rio: s\u00F3 os dele em agentes que ainda pode usar.\n *\n * @param {SmoothAgentApi.ChatsListRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.list()\n */\n public async list(\n request: SmoothAgentApi.ChatsListRequest = {},\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.Page<SmoothAgentApi.Chat, SmoothAgentApi.ChatsListResponse>> {\n const list = core.HttpResponsePromise.interceptFunction(\n async (\n request: SmoothAgentApi.ChatsListRequest,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ChatsListResponse>> => {\n const {\n limit,\n cursor,\n agentId,\n userId,\n state,\n \"SmoothAgent-Workspace\": smoothAgentWorkspace,\n \"SmoothAgent-As-User\": smoothAgentAsUser,\n } = request;\n const _queryParams: Record<string, unknown> = {\n limit,\n cursor,\n agentId,\n userId,\n state,\n };\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({\n \"SmoothAgent-Workspace\": smoothAgentWorkspace,\n \"SmoothAgent-As-User\": smoothAgentAsUser,\n }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n \"chats\",\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url\n .queryBuilder()\n .addMany(_queryParams)\n .add(\"limit\", _queryParams.limit, { style: \"comma\" })\n .add(\"cursor\", _queryParams.cursor, { style: \"comma\" })\n .add(\"agentId\", _queryParams.agentId, { style: \"comma\" })\n .add(\"userId\", _queryParams.userId, { style: \"comma\" })\n .add(\"state\", _queryParams.state, { style: \"comma\" })\n .mergeAdditional(requestOptions?.queryParams)\n .build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return {\n data: _response.body as SmoothAgentApi.ChatsListResponse,\n rawResponse: _response.rawResponse,\n };\n }\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/chats\");\n },\n );\n const dataWithRawResponse = await list(request).withRawResponse();\n return new core.Page<SmoothAgentApi.Chat, SmoothAgentApi.ChatsListResponse>({\n response: dataWithRawResponse.data,\n rawResponse: dataWithRawResponse.rawResponse,\n hasNextPage: (response) =>\n response?.nextCursor != null &&\n !(typeof response?.nextCursor === \"string\" && response?.nextCursor === \"\"),\n getItems: (response) => response?.data ?? [],\n loadPage: (response) => {\n return list(core.setObjectProperty(request, \"cursor\", response?.nextCursor));\n },\n });\n }\n\n /**\n * @param {SmoothAgentApi.CreateChat} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.create({\n * agentId: \"agentId\"\n * })\n */\n public create(\n request: SmoothAgentApi.CreateChat,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.Chat> {\n return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));\n }\n\n private async __create(\n request: SmoothAgentApi.CreateChat,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.Chat>> {\n const {\n \"SmoothAgent-Workspace\": smoothAgentWorkspace,\n \"SmoothAgent-As-User\": smoothAgentAsUser,\n \"Idempotency-Key\": idempotencyKey,\n ..._body\n } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({\n \"SmoothAgent-Workspace\": smoothAgentWorkspace,\n \"SmoothAgent-As-User\": smoothAgentAsUser,\n \"Idempotency-Key\": idempotencyKey,\n }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n \"chats\",\n ),\n method: \"POST\",\n headers: _headers,\n contentType: \"application/json\",\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n requestType: \"json\",\n body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.Chat, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"POST\", \"/chats\");\n }\n\n /**\n * @param {SmoothAgentApi.ChatsGetRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.get({\n * id: \"id\"\n * })\n */\n public get(\n request: SmoothAgentApi.ChatsGetRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.Chat> {\n return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));\n }\n\n private async __get(\n request: SmoothAgentApi.ChatsGetRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.Chat>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.Chat, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/chats/{id}\");\n }\n\n /**\n * Apaga o chat, o log e a box pr\u00F3pria (a inst\u00E2ncia s\u00F3 \u00E9 destru\u00EDda aqui).O chat some NA HORA (404 em toda rota, inclusive o `/live`; o socket aberto recebe `bye`). A limpeza da box pr\u00F3pria\n * (Detona) segue em segundo plano \u2014 `cleanup: pending` \u2014 e um cron repete at\u00E9 destruir (com teto e alerta).\n *\n * @param {SmoothAgentApi.ChatsDeleteRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.delete({\n * id: \"id\"\n * })\n */\n public delete(\n request: SmoothAgentApi.ChatsDeleteRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.ChatDeleted> {\n return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));\n }\n\n private async __delete(\n request: SmoothAgentApi.ChatsDeleteRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ChatDeleted>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}`,\n ),\n method: \"DELETE\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.ChatDeleted, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"DELETE\", \"/chats/{id}\");\n }\n\n /**\n * @param {SmoothAgentApi.ChatsUpdateRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.update({\n * id: \"id\"\n * })\n */\n public update(\n request: SmoothAgentApi.ChatsUpdateRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.Chat> {\n return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));\n }\n\n private async __update(\n request: SmoothAgentApi.ChatsUpdateRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.Chat>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser, ..._body } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}`,\n ),\n method: \"PATCH\",\n headers: _headers,\n contentType: \"application/json\",\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n requestType: \"json\",\n body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.Chat, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"PATCH\", \"/chats/{id}\");\n }\n\n /**\n * `forbidden {reason:'grant'}` sem acesso ao agente novo; `provider_not_connected` se o\n * modelo/provedor novo n\u00E3o tem credencial; `invalid_request {param:'model'|'effort'}` fora das\n * op\u00E7\u00F5es. O grant \u00E9 rechecado na hora de efetivar (troca agendada + grant revogado =\n * `agent.switch_failed`).\n *\n * @param {SmoothAgentApi.SwitchAgent} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.switchAgent({\n * id: \"id\",\n * agentId: \"agentId\"\n * })\n */\n public switchAgent(\n request: SmoothAgentApi.SwitchAgent,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.SwitchResult> {\n return core.HttpResponsePromise.fromPromise(this.__switchAgent(request, requestOptions));\n }\n\n private async __switchAgent(\n request: SmoothAgentApi.SwitchAgent,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.SwitchResult>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey, ..._body } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/agent`,\n ),\n method: \"PUT\",\n headers: _headers,\n contentType: \"application/json\",\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n requestType: \"json\",\n body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.SwitchResult, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"PUT\", \"/chats/{id}/agent\");\n }\n\n /**\n * Cancela a troca pendente: vira uma troca pro agente ATUAL, que a fila trata como \"limpa a pendente, n\u00E3o\n * aplica nada\" (sem `agent.switched`, sem handoff). Sem pendente = nada muda. `ref` opcional =\n * idempot\u00EAncia (vira o `switchId`).\n *\n * @param {SmoothAgentApi.CancelSwitchChatsRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.cancelSwitch({\n * id: \"id\"\n * })\n */\n public cancelSwitch(\n request: SmoothAgentApi.CancelSwitchChatsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.Chat> {\n return core.HttpResponsePromise.fromPromise(this.__cancelSwitch(request, requestOptions));\n }\n\n private async __cancelSwitch(\n request: SmoothAgentApi.CancelSwitchChatsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.Chat>> {\n const { id, ref, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _queryParams: Record<string, unknown> = {\n ref,\n };\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/agent/scheduled`,\n ),\n method: \"DELETE\",\n headers: _headers,\n queryString: core.url\n .queryBuilder()\n .addMany(_queryParams)\n .add(\"ref\", _queryParams.ref, { style: \"comma\" })\n .mergeAdditional(requestOptions?.queryParams)\n .build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.Chat, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(\n _response.error,\n _response.rawResponse,\n \"DELETE\",\n \"/chats/{id}/agent/scheduled\",\n );\n }\n\n /**\n * @param {SmoothAgentApi.GetContextChatsRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.getContext({\n * id: \"id\"\n * })\n */\n public getContext(\n request: SmoothAgentApi.GetContextChatsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.ChatContext> {\n return core.HttpResponsePromise.fromPromise(this.__getContext(request, requestOptions));\n }\n\n private async __getContext(\n request: SmoothAgentApi.GetContextChatsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ChatContext>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/context`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.ChatContext, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/chats/{id}/context\");\n }\n\n /**\n * SSE s\u00F3-leitura (`after` = cursor). O WebSocket (com comandos) \u00E9 `/live`, do `realtime`.\n */\n public events(\n request: SmoothAgentApi.ChatsEventsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<core.Stream<SmoothAgentApi.EventsEvent>> {\n return core.HttpResponsePromise.fromPromise(this.__events(request, requestOptions));\n }\n\n private async __events(\n request: SmoothAgentApi.ChatsEventsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<core.Stream<SmoothAgentApi.EventsEvent>>> {\n const { id, after, \"SmoothAgent-As-User\": smoothAgentAsUser, accept } = request;\n const _queryParams: Record<string, unknown> = {\n after,\n };\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser, accept: accept }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher<ReadableStream>({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/events`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url\n .queryBuilder()\n .addMany(_queryParams)\n .add(\"after\", _queryParams.after, { style: \"comma\" })\n .mergeAdditional(requestOptions?.queryParams)\n .build(),\n responseType: \"sse\",\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return {\n data: new core.Stream({\n stream: _response.body,\n parse: (data) => data as any,\n signal: requestOptions?.abortSignal,\n eventShape: {\n type: \"sse\",\n },\n }),\n rawResponse: _response.rawResponse,\n };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/chats/{id}/events\");\n }\n\n /**\n * O buraco em JSON: eventos `(after, until]`.\n *\n * @param {SmoothAgentApi.EventsRangeChatsRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.eventsRange({\n * id: \"id\",\n * after: 1000000\n * })\n */\n public eventsRange(\n request: SmoothAgentApi.EventsRangeChatsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.EventRange> {\n return core.HttpResponsePromise.fromPromise(this.__eventsRange(request, requestOptions));\n }\n\n private async __eventsRange(\n request: SmoothAgentApi.EventsRangeChatsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.EventRange>> {\n const { id, after, until, limit, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _queryParams: Record<string, unknown> = {\n after,\n until,\n limit,\n };\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/events/range`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url\n .queryBuilder()\n .addMany(_queryParams)\n .add(\"after\", _queryParams.after, { style: \"comma\" })\n .add(\"until\", _queryParams.until, { style: \"comma\" })\n .add(\"limit\", _queryParams.limit, { style: \"comma\" })\n .mergeAdditional(requestOptions?.queryParams)\n .build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.EventRange, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/chats/{id}/events/range\");\n }\n\n /**\n * `path` relativo ao diret\u00F3rio de trabalho do chat (sem `..`); ausente = a raiz.\n *\n * @param {SmoothAgentApi.ChatBoxListFilesRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.chatBoxListFiles({\n * id: \"id\"\n * })\n */\n public chatBoxListFiles(\n request: SmoothAgentApi.ChatBoxListFilesRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.BoxFileList> {\n return core.HttpResponsePromise.fromPromise(this.__chatBoxListFiles(request, requestOptions));\n }\n\n private async __chatBoxListFiles(\n request: SmoothAgentApi.ChatBoxListFilesRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.BoxFileList>> {\n const { id, path, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _queryParams: Record<string, unknown> = {\n path,\n };\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/files`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url\n .queryBuilder()\n .addMany(_queryParams)\n .add(\"path\", _queryParams.path, { style: \"comma\" })\n .mergeAdditional(requestOptions?.queryParams)\n .build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.BoxFileList, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/chats/{id}/files\");\n }\n\n /**\n * @param {SmoothAgentApi.ChatBoxReadFileRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.chatBoxReadFile({\n * id: \"id\",\n * path: \"path\"\n * })\n */\n public chatBoxReadFile(\n request: SmoothAgentApi.ChatBoxReadFileRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.BoxFileContent> {\n return core.HttpResponsePromise.fromPromise(this.__chatBoxReadFile(request, requestOptions));\n }\n\n private async __chatBoxReadFile(\n request: SmoothAgentApi.ChatBoxReadFileRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.BoxFileContent>> {\n const { id, path, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _queryParams: Record<string, unknown> = {\n path,\n };\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/files/content`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url\n .queryBuilder()\n .addMany(_queryParams)\n .add(\"path\", _queryParams.path, { style: \"comma\" })\n .mergeAdditional(requestOptions?.queryParams)\n .build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.BoxFileContent, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/chats/{id}/files/content\");\n }\n\n /**\n * Hist\u00F3rico paginado por itens fechados. Cursores = n\u00FAmero do evento:\n * `before=N` (rolar pra cima), `after=N` (pra baixo / tapar buraco), `around=<msg_\u2026|N>`\n * (abrir numa mensagem, metade pra cada lado), `anchor=end` (pular pro fim). `limit` 1\u2013200,\n * padr\u00E3o 50. Mais de um \u00E2ncora = `invalid_request`.\n *\n * @param {SmoothAgentApi.ChatsHistoryRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.history({\n * id: \"id\"\n * })\n */\n public history(\n request: SmoothAgentApi.ChatsHistoryRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.HistoryPage> {\n return core.HttpResponsePromise.fromPromise(this.__history(request, requestOptions));\n }\n\n private async __history(\n request: SmoothAgentApi.ChatsHistoryRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.HistoryPage>> {\n const { id, before, after, around, anchor, limit, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _queryParams: Record<string, unknown> = {\n before,\n after,\n around,\n anchor: anchor != null ? anchor : undefined,\n limit,\n };\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/history`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url\n .queryBuilder()\n .addMany(_queryParams)\n .add(\"before\", _queryParams.before, { style: \"comma\" })\n .add(\"after\", _queryParams.after, { style: \"comma\" })\n .add(\"around\", _queryParams.around, { style: \"comma\" })\n .add(\"anchor\", _queryParams.anchor, { style: \"comma\" })\n .add(\"limit\", _queryParams.limit, { style: \"comma\" })\n .mergeAdditional(requestOptions?.queryParams)\n .build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.HistoryPage, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/chats/{id}/history\");\n }\n\n /**\n * Janelas de uso da CREDENCIAL QUE RODA ESTE CHAT (a do agente ou a do usu\u00E1rio \u2014 a tela n\u00E3o\n * precisa saber qual). Mesmo formato de `/me/providers/{p}/limits`.\n *\n * @param {SmoothAgentApi.ChatsLimitsRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.limits({\n * id: \"id\"\n * })\n */\n public limits(\n request: SmoothAgentApi.ChatsLimitsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.ProviderLimits> {\n return core.HttpResponsePromise.fromPromise(this.__limits(request, requestOptions));\n }\n\n private async __limits(\n request: SmoothAgentApi.ChatsLimitsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ProviderLimits>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/limits`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.ProviderLimits, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/chats/{id}/limits\");\n }\n\n /**\n * Chat num computador (m\u00E1quina `local`) desligado = 409 `machine_offline`, qualquer `whenOffline`: nada fica pendente em sil\u00EAncio.\n *\n * @param {SmoothAgentApi.SendMessage} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.send({\n * id: \"id\",\n * content: \"content\"\n * })\n */\n public send(\n request: SmoothAgentApi.SendMessage,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.ChatsSendResponse> {\n return core.HttpResponsePromise.fromPromise(this.__send(request, requestOptions));\n }\n\n private async __send(\n request: SmoothAgentApi.SendMessage,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ChatsSendResponse>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey, ..._body } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/messages`,\n ),\n method: \"POST\",\n headers: _headers,\n contentType: \"application/json\",\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n requestType: \"json\",\n body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.ChatsSendResponse, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"POST\", \"/chats/{id}/messages\");\n }\n\n /**\n * Reenvia uma mensagem que voltou `notDelivered` (mesmo `messageId`; repetir \u00E9 inofensivo).\n *\n * @param {SmoothAgentApi.ChatsResendRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.resend({\n * id: \"id\",\n * messageId: \"messageId\"\n * })\n */\n public resend(\n request: SmoothAgentApi.ChatsResendRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.ChatsResendResponse> {\n return core.HttpResponsePromise.fromPromise(this.__resend(request, requestOptions));\n }\n\n private async __resend(\n request: SmoothAgentApi.ChatsResendRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ChatsResendResponse>> {\n const { id, messageId, \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/messages/${core.url.encodePathParam(messageId, errors.SmoothAgentApiError)}/resend`,\n ),\n method: \"POST\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.ChatsResendResponse, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(\n _response.error,\n _response.rawResponse,\n \"POST\",\n \"/chats/{id}/messages/{messageId}/resend\",\n );\n }\n\n /**\n * Pendentes, fila, notDelivered, STOP pendente, troca agendada \u2014 e a `version`.\n *\n * @param {SmoothAgentApi.ChatsQueueRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.queue({\n * id: \"id\"\n * })\n */\n public queue(\n request: SmoothAgentApi.ChatsQueueRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.EventsInboxState> {\n return core.HttpResponsePromise.fromPromise(this.__queue(request, requestOptions));\n }\n\n private async __queue(\n request: SmoothAgentApi.ChatsQueueRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.EventsInboxState>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/queue`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.EventsInboxState, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/chats/{id}/queue\");\n }\n\n /**\n * @param {SmoothAgentApi.ReorderQueueChatsRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.reorderQueue({\n * id: \"id\",\n * baseVersion: 1,\n * order: [\"order\"]\n * })\n */\n public reorderQueue(\n request: SmoothAgentApi.ReorderQueueChatsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.QueueResult> {\n return core.HttpResponsePromise.fromPromise(this.__reorderQueue(request, requestOptions));\n }\n\n private async __reorderQueue(\n request: SmoothAgentApi.ReorderQueueChatsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.QueueResult>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey, ..._body } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/queue/order`,\n ),\n method: \"PUT\",\n headers: _headers,\n contentType: \"application/json\",\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n requestType: \"json\",\n body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.QueueResult, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"PUT\", \"/chats/{id}/queue/order\");\n }\n\n /**\n * @param {SmoothAgentApi.RemoveQueuedChatsRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.removeQueued({\n * id: \"id\",\n * messageId: \"messageId\",\n * baseVersion: 1\n * })\n */\n public removeQueued(\n request: SmoothAgentApi.RemoveQueuedChatsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.QueueResult> {\n return core.HttpResponsePromise.fromPromise(this.__removeQueued(request, requestOptions));\n }\n\n private async __removeQueued(\n request: SmoothAgentApi.RemoveQueuedChatsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.QueueResult>> {\n const { id, messageId, baseVersion, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _queryParams: Record<string, unknown> = {\n baseVersion,\n };\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/queue/${core.url.encodePathParam(messageId, errors.SmoothAgentApiError)}`,\n ),\n method: \"DELETE\",\n headers: _headers,\n queryString: core.url\n .queryBuilder()\n .addMany(_queryParams)\n .add(\"baseVersion\", _queryParams.baseVersion, { style: \"comma\" })\n .mergeAdditional(requestOptions?.queryParams)\n .build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.QueueResult, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(\n _response.error,\n _response.rawResponse,\n \"DELETE\",\n \"/chats/{id}/queue/{messageId}\",\n );\n }\n\n /**\n * @param {SmoothAgentApi.EditQueuedChatsRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.editQueued({\n * id: \"id\",\n * messageId: \"messageId\",\n * baseVersion: 1,\n * content: \"content\"\n * })\n */\n public editQueued(\n request: SmoothAgentApi.EditQueuedChatsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.QueueResult> {\n return core.HttpResponsePromise.fromPromise(this.__editQueued(request, requestOptions));\n }\n\n private async __editQueued(\n request: SmoothAgentApi.EditQueuedChatsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.QueueResult>> {\n const { id, messageId, \"SmoothAgent-As-User\": smoothAgentAsUser, ..._body } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/queue/${core.url.encodePathParam(messageId, errors.SmoothAgentApiError)}`,\n ),\n method: \"PATCH\",\n headers: _headers,\n contentType: \"application/json\",\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n requestType: \"json\",\n body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.QueueResult, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(\n _response.error,\n _response.rawResponse,\n \"PATCH\",\n \"/chats/{id}/queue/{messageId}\",\n );\n }\n\n /**\n * Promove a steer (ou come\u00E7a, se o agente parou).\n *\n * @param {SmoothAgentApi.SendNowChatsRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.sendNow({\n * id: \"id\",\n * messageId: \"messageId\",\n * baseVersion: 1\n * })\n */\n public sendNow(\n request: SmoothAgentApi.SendNowChatsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.QueueResult> {\n return core.HttpResponsePromise.fromPromise(this.__sendNow(request, requestOptions));\n }\n\n private async __sendNow(\n request: SmoothAgentApi.SendNowChatsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.QueueResult>> {\n const {\n id,\n messageId,\n \"SmoothAgent-As-User\": smoothAgentAsUser,\n \"Idempotency-Key\": idempotencyKey,\n ..._body\n } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/queue/${core.url.encodePathParam(messageId, errors.SmoothAgentApiError)}/send-now`,\n ),\n method: \"POST\",\n headers: _headers,\n contentType: \"application/json\",\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n requestType: \"json\",\n body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.QueueResult, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(\n _response.error,\n _response.rawResponse,\n \"POST\",\n \"/chats/{id}/queue/{messageId}/send-now\",\n );\n }\n\n /**\n * Marca como lido at\u00E9 `seq` (padr\u00E3o = o \u00FAltimo); monot\u00F4nico. S\u00F3 principal de usu\u00E1rio (P8).\n *\n * @param {SmoothAgentApi.MarkReadChatsRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.markRead({\n * id: \"id\"\n * })\n */\n public markRead(\n request: SmoothAgentApi.MarkReadChatsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.MarkReadChatsResponse> {\n return core.HttpResponsePromise.fromPromise(this.__markRead(request, requestOptions));\n }\n\n private async __markRead(\n request: SmoothAgentApi.MarkReadChatsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.MarkReadChatsResponse>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey, ..._body } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/read`,\n ),\n method: \"POST\",\n headers: _headers,\n contentType: \"application/json\",\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n requestType: \"json\",\n body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.MarkReadChatsResponse, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"POST\", \"/chats/{id}/read\");\n }\n\n /**\n * Sess\u00E3o nova do provedor (o recycle do chat); `clearHistory` tamb\u00E9m esconde o hist\u00F3rico at\u00E9 aqui.\n *\n * @param {SmoothAgentApi.ChatsResetRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.reset({\n * id: \"id\"\n * })\n */\n public reset(\n request: SmoothAgentApi.ChatsResetRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.Chat> {\n return core.HttpResponsePromise.fromPromise(this.__reset(request, requestOptions));\n }\n\n private async __reset(\n request: SmoothAgentApi.ChatsResetRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.Chat>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey, ..._body } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/reset`,\n ),\n method: \"POST\",\n headers: _headers,\n contentType: \"application/json\",\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n requestType: \"json\",\n body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.Chat, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"POST\", \"/chats/{id}/reset\");\n }\n\n /**\n * @param {SmoothAgentApi.ChatsRespondRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.respond({\n * id: \"id\",\n * requestId: \"requestId\",\n * answer: {\n * \"key\": \"value\"\n * }\n * })\n */\n public respond(\n request: SmoothAgentApi.ChatsRespondRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.ChatsRespondResponse> {\n return core.HttpResponsePromise.fromPromise(this.__respond(request, requestOptions));\n }\n\n private async __respond(\n request: SmoothAgentApi.ChatsRespondRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ChatsRespondResponse>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey, ..._body } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/respond`,\n ),\n method: \"POST\",\n headers: _headers,\n contentType: \"application/json\",\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n requestType: \"json\",\n body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.ChatsRespondResponse, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"POST\", \"/chats/{id}/respond\");\n }\n\n /**\n * @param {SmoothAgentApi.ChatsRunsRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.runs({\n * id: \"id\"\n * })\n */\n public async runs(\n request: SmoothAgentApi.ChatsRunsRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.Page<SmoothAgentApi.RunSummary, SmoothAgentApi.ChatsRunsResponse>> {\n const list = core.HttpResponsePromise.interceptFunction(\n async (\n request: SmoothAgentApi.ChatsRunsRequest,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ChatsRunsResponse>> => {\n const { id, limit, cursor, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _queryParams: Record<string, unknown> = {\n limit,\n cursor,\n };\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/runs`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url\n .queryBuilder()\n .addMany(_queryParams)\n .add(\"limit\", _queryParams.limit, { style: \"comma\" })\n .add(\"cursor\", _queryParams.cursor, { style: \"comma\" })\n .mergeAdditional(requestOptions?.queryParams)\n .build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return {\n data: _response.body as SmoothAgentApi.ChatsRunsResponse,\n rawResponse: _response.rawResponse,\n };\n }\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/chats/{id}/runs\");\n },\n );\n const dataWithRawResponse = await list(request).withRawResponse();\n return new core.Page<SmoothAgentApi.RunSummary, SmoothAgentApi.ChatsRunsResponse>({\n response: dataWithRawResponse.data,\n rawResponse: dataWithRawResponse.rawResponse,\n hasNextPage: (response) =>\n response?.nextCursor != null &&\n !(typeof response?.nextCursor === \"string\" && response?.nextCursor === \"\"),\n getItems: (response) => response?.data ?? [],\n loadPage: (response) => {\n return list(core.setObjectProperty(request, \"cursor\", response?.nextCursor));\n },\n });\n }\n\n /**\n * @param {SmoothAgentApi.ChatsRunRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.run({\n * id: \"id\",\n * runId: \"runId\"\n * })\n */\n public run(\n request: SmoothAgentApi.ChatsRunRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.RunSummary> {\n return core.HttpResponsePromise.fromPromise(this.__run(request, requestOptions));\n }\n\n private async __run(\n request: SmoothAgentApi.ChatsRunRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.RunSummary>> {\n const { id, runId, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/runs/${core.url.encodePathParam(runId, errors.SmoothAgentApiError)}`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.RunSummary, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/chats/{id}/runs/{runId}\");\n }\n\n /**\n * @param {SmoothAgentApi.ChatsSelectionRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.selection({\n * id: \"id\"\n * })\n */\n public selection(\n request: SmoothAgentApi.ChatsSelectionRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.ChatSelection> {\n return core.HttpResponsePromise.fromPromise(this.__selection(request, requestOptions));\n }\n\n private async __selection(\n request: SmoothAgentApi.ChatsSelectionRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ChatSelection>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/selection`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.ChatSelection, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/chats/{id}/selection\");\n }\n\n /**\n * O mesmo SnapshotPayload do frame `snapshot` do realtime (`seq, inbox, box?, recentItems?, hasBefore?, state?`):\n * resync sem socket. O formato \u00E9 do protocolo do realtime.\n *\n * @param {SmoothAgentApi.ChatsSnapshotRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.snapshot({\n * id: \"id\"\n * })\n */\n public snapshot(\n request: SmoothAgentApi.ChatsSnapshotRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<Record<string, unknown>> {\n return core.HttpResponsePromise.fromPromise(this.__snapshot(request, requestOptions));\n }\n\n private async __snapshot(\n request: SmoothAgentApi.ChatsSnapshotRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<Record<string, unknown>>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/snapshot`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as Record<string, unknown>, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/chats/{id}/snapshot\");\n }\n\n /**\n * @param {SmoothAgentApi.ChatsStopRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.stop({\n * id: \"id\"\n * })\n */\n public stop(\n request: SmoothAgentApi.ChatsStopRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.ChatsStopResponse> {\n return core.HttpResponsePromise.fromPromise(this.__stop(request, requestOptions));\n }\n\n private async __stop(\n request: SmoothAgentApi.ChatsStopRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ChatsStopResponse>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/stop`,\n ),\n method: \"POST\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.ChatsStopResponse, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"POST\", \"/chats/{id}/stop\");\n }\n\n /**\n * @param {SmoothAgentApi.ChatBoxListTasksRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.chatBoxListTasks({\n * id: \"id\"\n * })\n */\n public chatBoxListTasks(\n request: SmoothAgentApi.ChatBoxListTasksRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.ChatBoxListTasksResponse> {\n return core.HttpResponsePromise.fromPromise(this.__chatBoxListTasks(request, requestOptions));\n }\n\n private async __chatBoxListTasks(\n request: SmoothAgentApi.ChatBoxListTasksRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ChatBoxListTasksResponse>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/tasks`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return {\n data: _response.body as SmoothAgentApi.ChatBoxListTasksResponse,\n rawResponse: _response.rawResponse,\n };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/chats/{id}/tasks\");\n }\n\n /**\n * @param {SmoothAgentApi.ChatBoxTaskOutputRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.chatBoxTaskOutput({\n * id: \"id\",\n * taskId: \"taskId\"\n * })\n */\n public chatBoxTaskOutput(\n request: SmoothAgentApi.ChatBoxTaskOutputRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.ChatTaskOutput> {\n return core.HttpResponsePromise.fromPromise(this.__chatBoxTaskOutput(request, requestOptions));\n }\n\n private async __chatBoxTaskOutput(\n request: SmoothAgentApi.ChatBoxTaskOutputRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ChatTaskOutput>> {\n const { id, taskId, after, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _queryParams: Record<string, unknown> = {\n after,\n };\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/tasks/${core.url.encodePathParam(taskId, errors.SmoothAgentApiError)}/output`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url\n .queryBuilder()\n .addMany(_queryParams)\n .add(\"after\", _queryParams.after, { style: \"comma\" })\n .mergeAdditional(requestOptions?.queryParams)\n .build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.ChatTaskOutput, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(\n _response.error,\n _response.rawResponse,\n \"GET\",\n \"/chats/{id}/tasks/{taskId}/output\",\n );\n }\n\n /**\n * Para UMA tarefa (subagente ou processo de fundo) sem matar o turno.\n *\n * @param {SmoothAgentApi.ChatBoxStopTaskRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.chatBoxStopTask({\n * id: \"id\",\n * taskId: \"taskId\"\n * })\n */\n public chatBoxStopTask(\n request: SmoothAgentApi.ChatBoxStopTaskRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.ChatBoxStopTaskResponse> {\n return core.HttpResponsePromise.fromPromise(this.__chatBoxStopTask(request, requestOptions));\n }\n\n private async __chatBoxStopTask(\n request: SmoothAgentApi.ChatBoxStopTaskRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ChatBoxStopTaskResponse>> {\n const { id, taskId, \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/tasks/${core.url.encodePathParam(taskId, errors.SmoothAgentApiError)}/stop`,\n ),\n method: \"POST\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return {\n data: _response.body as SmoothAgentApi.ChatBoxStopTaskResponse,\n rawResponse: _response.rawResponse,\n };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(\n _response.error,\n _response.rawResponse,\n \"POST\",\n \"/chats/{id}/tasks/{taskId}/stop\",\n );\n }\n\n /**\n * @param {SmoothAgentApi.ChatsUsageRequest} request\n * @param {ChatsClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.chats.usage({\n * id: \"id\"\n * })\n */\n public usage(\n request: SmoothAgentApi.ChatsUsageRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.ChatUsage> {\n return core.HttpResponsePromise.fromPromise(this.__usage(request, requestOptions));\n }\n\n private async __usage(\n request: SmoothAgentApi.ChatsUsageRequest,\n requestOptions?: ChatsClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ChatUsage>> {\n const { id, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `chats/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/usage`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.ChatUsage, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/chats/{id}/usage\");\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type { BaseClientOptions, BaseRequestOptions } from \"../../../../BaseClient.js\";\nimport { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from \"../../../../BaseClient.js\";\nimport { mergeHeaders, mergeOnlyDefinedHeaders } from \"../../../../core/headers.js\";\nimport * as core from \"../../../../core/index.js\";\nimport { toJson } from \"../../../../core/json.js\";\nimport { mergeAdditionalBodyParameters } from \"../../../../core/requestBody.js\";\nimport * as environments from \"../../../../environments.js\";\nimport { handleNonStatusCodeError } from \"../../../../errors/handleNonStatusCodeError.js\";\nimport * as errors from \"../../../../errors/index.js\";\nimport * as SmoothAgentApi from \"../../../index.js\";\n\nexport declare namespace FilesClient {\n export type Options = BaseClientOptions;\n\n export interface RequestOptions extends BaseRequestOptions {}\n}\n\nexport class FilesClient {\n protected readonly _options: NormalizedClientOptionsWithAuth<FilesClient.Options>;\n\n constructor(options: FilesClient.Options) {\n this._options = normalizeClientOptionsWithAuth(options);\n }\n\n /**\n * @param {SmoothAgentApi.FilesUploadRequest} request\n * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n */\n public upload(\n request: SmoothAgentApi.FilesUploadRequest,\n requestOptions?: FilesClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.FileObject> {\n return core.HttpResponsePromise.fromPromise(this.__upload(request, requestOptions));\n }\n\n private async __upload(\n request: SmoothAgentApi.FilesUploadRequest,\n requestOptions?: FilesClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.FileObject>> {\n const _body = await core.newFormData();\n if (request.file != null) {\n if (Array.isArray(request.file) || request.file instanceof Set)\n for (const _item of request.file) {\n _body.append(\"file\", typeof _item === \"string\" ? _item : toJson(_item));\n }\n }\n\n const _maybeEncodedRequest = await _body.getRequest();\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({\n \"SmoothAgent-Workspace\": request[\"SmoothAgent-Workspace\"],\n \"SmoothAgent-As-User\": request[\"SmoothAgent-As-User\"],\n \"Idempotency-Key\": request[\"Idempotency-Key\"],\n ..._maybeEncodedRequest.headers,\n }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n \"files\",\n ),\n method: \"POST\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n requestType: \"file\",\n duplex: _maybeEncodedRequest.duplex,\n body: _maybeEncodedRequest.body,\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.FileObject, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"POST\", \"/files\");\n }\n\n /**\n * Arquivo grande: devolve a URL assinada (15 min).\n *\n * @param {SmoothAgentApi.CreateUploadFilesRequest} request\n * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.files.createUpload({\n * filename: \"filename\",\n * mimeType: \"mimeType\",\n * sizeBytes: 1000000\n * })\n */\n public createUpload(\n request: SmoothAgentApi.CreateUploadFilesRequest,\n requestOptions?: FilesClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.CreateUploadFilesResponse> {\n return core.HttpResponsePromise.fromPromise(this.__createUpload(request, requestOptions));\n }\n\n private async __createUpload(\n request: SmoothAgentApi.CreateUploadFilesRequest,\n requestOptions?: FilesClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.CreateUploadFilesResponse>> {\n const {\n \"SmoothAgent-Workspace\": smoothAgentWorkspace,\n \"SmoothAgent-As-User\": smoothAgentAsUser,\n \"Idempotency-Key\": idempotencyKey,\n ..._body\n } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({\n \"SmoothAgent-Workspace\": smoothAgentWorkspace,\n \"SmoothAgent-As-User\": smoothAgentAsUser,\n \"Idempotency-Key\": idempotencyKey,\n }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n \"files/uploads\",\n ),\n method: \"POST\",\n headers: _headers,\n contentType: \"application/json\",\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n requestType: \"json\",\n body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return {\n data: _response.body as SmoothAgentApi.CreateUploadFilesResponse,\n rawResponse: _response.rawResponse,\n };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"POST\", \"/files/uploads\");\n }\n\n /**\n * @param {SmoothAgentApi.FilesGetRequest} request\n * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.files.get({\n * id: \"id\"\n * })\n */\n public get(\n request: SmoothAgentApi.FilesGetRequest,\n requestOptions?: FilesClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.FileObject> {\n return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));\n }\n\n private async __get(\n request: SmoothAgentApi.FilesGetRequest,\n requestOptions?: FilesClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.FileObject>> {\n const { id } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `files/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.FileObject, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/files/{id}\");\n }\n\n /**\n * @param {SmoothAgentApi.FilesDeleteRequest} request\n * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.files.delete({\n * id: \"id\"\n * })\n */\n public delete(\n request: SmoothAgentApi.FilesDeleteRequest,\n requestOptions?: FilesClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.Deleted> {\n return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));\n }\n\n private async __delete(\n request: SmoothAgentApi.FilesDeleteRequest,\n requestOptions?: FilesClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.Deleted>> {\n const { id } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `files/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}`,\n ),\n method: \"DELETE\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.Deleted, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"DELETE\", \"/files/{id}\");\n }\n\n /**\n * @param {SmoothAgentApi.FilesCompleteRequest} request\n * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.files.complete({\n * id: \"id\"\n * })\n */\n public complete(\n request: SmoothAgentApi.FilesCompleteRequest,\n requestOptions?: FilesClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.FileObject> {\n return core.HttpResponsePromise.fromPromise(this.__complete(request, requestOptions));\n }\n\n private async __complete(\n request: SmoothAgentApi.FilesCompleteRequest,\n requestOptions?: FilesClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.FileObject>> {\n const { id, \"Idempotency-Key\": idempotencyKey } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"Idempotency-Key\": idempotencyKey }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `files/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/complete`,\n ),\n method: \"POST\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.FileObject, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"POST\", \"/files/{id}/complete\");\n }\n\n /**\n * @param {SmoothAgentApi.FilesContentRequest} request\n * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.files.content({\n * id: \"id\"\n * })\n */\n public content(\n request: SmoothAgentApi.FilesContentRequest,\n requestOptions?: FilesClient.RequestOptions,\n ): core.HttpResponsePromise<void> {\n return core.HttpResponsePromise.fromPromise(this.__content(request, requestOptions));\n }\n\n private async __content(\n request: SmoothAgentApi.FilesContentRequest,\n requestOptions?: FilesClient.RequestOptions,\n ): Promise<core.WithRawResponse<void>> {\n const { id } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `files/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}/content`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: undefined, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/files/{id}/content\");\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type { BaseClientOptions, BaseRequestOptions } from \"../../../../BaseClient.js\";\nimport { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from \"../../../../BaseClient.js\";\nimport { mergeHeaders, mergeOnlyDefinedHeaders } from \"../../../../core/headers.js\";\nimport * as core from \"../../../../core/index.js\";\nimport * as environments from \"../../../../environments.js\";\nimport { handleNonStatusCodeError } from \"../../../../errors/handleNonStatusCodeError.js\";\nimport * as errors from \"../../../../errors/index.js\";\nimport * as SmoothAgentApi from \"../../../index.js\";\n\nexport declare namespace IdentityClient {\n export type Options = BaseClientOptions;\n\n export interface RequestOptions extends BaseRequestOptions {}\n}\n\nexport class IdentityClient {\n protected readonly _options: NormalizedClientOptionsWithAuth<IdentityClient.Options>;\n\n constructor(options: IdentityClient.Options) {\n this._options = normalizeClientOptionsWithAuth(options);\n }\n\n /**\n * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.identity.meWhoami()\n */\n public meWhoami(\n requestOptions?: IdentityClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.MeWhoamiResponse> {\n return core.HttpResponsePromise.fromPromise(this.__meWhoami(requestOptions));\n }\n\n private async __meWhoami(\n requestOptions?: IdentityClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.MeWhoamiResponse>> {\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n \"me\",\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.MeWhoamiResponse, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/me\");\n }\n\n /**\n * A lista lateral ao vivo (UserFeed do realtime): WebSocket (upgrade) ou SSE. S\u00F3 token de usu\u00E1rio.\n */\n public meFeed(\n request: SmoothAgentApi.MeFeedRequest,\n requestOptions?: IdentityClient.RequestOptions,\n ): core.HttpResponsePromise<core.Stream<string>> {\n return core.HttpResponsePromise.fromPromise(this.__meFeed(request, requestOptions));\n }\n\n private async __meFeed(\n request: SmoothAgentApi.MeFeedRequest,\n requestOptions?: IdentityClient.RequestOptions,\n ): Promise<core.WithRawResponse<core.Stream<string>>> {\n const { accept } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ accept: accept }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher<ReadableStream>({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n \"me/feed\",\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n responseType: \"sse\",\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return {\n data: new core.Stream({\n stream: _response.body,\n parse: (data) => data as any,\n signal: requestOptions?.abortSignal,\n eventShape: {\n type: \"sse\",\n },\n }),\n rawResponse: _response.rawResponse,\n };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/me/feed\");\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type { BaseClientOptions, BaseRequestOptions } from \"../../../../BaseClient.js\";\nimport { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from \"../../../../BaseClient.js\";\nimport { mergeHeaders, mergeOnlyDefinedHeaders } from \"../../../../core/headers.js\";\nimport * as core from \"../../../../core/index.js\";\nimport { mergeAdditionalBodyParameters } from \"../../../../core/requestBody.js\";\nimport * as environments from \"../../../../environments.js\";\nimport { handleNonStatusCodeError } from \"../../../../errors/handleNonStatusCodeError.js\";\nimport * as errors from \"../../../../errors/index.js\";\nimport * as SmoothAgentApi from \"../../../index.js\";\n\nexport declare namespace MachinesClient {\n export type Options = BaseClientOptions;\n\n export interface RequestOptions extends BaseRequestOptions {}\n}\n\nexport class MachinesClient {\n protected readonly _options: NormalizedClientOptionsWithAuth<MachinesClient.Options>;\n\n constructor(options: MachinesClient.Options) {\n this._options = normalizeClientOptionsWithAuth(options);\n }\n\n /**\n * Chave: as do workspace (filtro userId/kind). Usu\u00E1rio: as dele \u2014 `local` s\u00F3 aparece ONLINE\n * (`includeOffline=true` pra tela de gerenciar dispositivos).\n *\n * @param {SmoothAgentApi.MachinesListRequest} request\n * @param {MachinesClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.machines.list()\n */\n public async list(\n request: SmoothAgentApi.MachinesListRequest = {},\n requestOptions?: MachinesClient.RequestOptions,\n ): Promise<core.Page<SmoothAgentApi.Machine, SmoothAgentApi.MachinesListResponse>> {\n const list = core.HttpResponsePromise.interceptFunction(\n async (\n request: SmoothAgentApi.MachinesListRequest,\n ): Promise<core.WithRawResponse<SmoothAgentApi.MachinesListResponse>> => {\n const {\n limit,\n cursor,\n userId,\n kind,\n includeOffline,\n \"SmoothAgent-Workspace\": smoothAgentWorkspace,\n } = request;\n const _queryParams: Record<string, unknown> = {\n limit,\n cursor,\n userId,\n kind,\n includeOffline,\n };\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-Workspace\": smoothAgentWorkspace }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n \"machines\",\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url\n .queryBuilder()\n .addMany(_queryParams)\n .add(\"limit\", _queryParams.limit, { style: \"comma\" })\n .add(\"cursor\", _queryParams.cursor, { style: \"comma\" })\n .add(\"userId\", _queryParams.userId, { style: \"comma\" })\n .add(\"kind\", _queryParams.kind, { style: \"comma\" })\n .add(\"includeOffline\", _queryParams.includeOffline, { style: \"comma\" })\n .mergeAdditional(requestOptions?.queryParams)\n .build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return {\n data: _response.body as SmoothAgentApi.MachinesListResponse,\n rawResponse: _response.rawResponse,\n };\n }\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/machines\");\n },\n );\n const dataWithRawResponse = await list(request).withRawResponse();\n return new core.Page<SmoothAgentApi.Machine, SmoothAgentApi.MachinesListResponse>({\n response: dataWithRawResponse.data,\n rawResponse: dataWithRawResponse.rawResponse,\n hasNextPage: (response) =>\n response?.nextCursor != null &&\n !(typeof response?.nextCursor === \"string\" && response?.nextCursor === \"\"),\n getItems: (response) => response?.data ?? [],\n loadPage: (response) => {\n return list(core.setObjectProperty(request, \"cursor\", response?.nextCursor));\n },\n });\n }\n\n /**\n * Gera o c\u00F3digo de pareamento de um computador. Chave (pra um `userId`) OU o pr\u00F3prio usu\u00E1rio\n * na interface do cliente (o login \u00E9 do cliente, nunca nosso).\n *\n * @param {SmoothAgentApi.MachinesPairRequest} request\n * @param {MachinesClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.machines.pair()\n */\n public pair(\n request: SmoothAgentApi.MachinesPairRequest = {},\n requestOptions?: MachinesClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.Pairing> {\n return core.HttpResponsePromise.fromPromise(this.__pair(request, requestOptions));\n }\n\n private async __pair(\n request: SmoothAgentApi.MachinesPairRequest = {},\n requestOptions?: MachinesClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.Pairing>> {\n const { \"SmoothAgent-Workspace\": smoothAgentWorkspace, \"Idempotency-Key\": idempotencyKey, ..._body } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({\n \"SmoothAgent-Workspace\": smoothAgentWorkspace,\n \"Idempotency-Key\": idempotencyKey,\n }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n \"machines/pairings\",\n ),\n method: \"POST\",\n headers: _headers,\n contentType: \"application/json\",\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n requestType: \"json\",\n body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.Pairing, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"POST\", \"/machines/pairings\");\n }\n\n /**\n * @param {SmoothAgentApi.PairingStatusMachinesRequest} request\n * @param {MachinesClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.machines.pairingStatus({\n * code: \"code\"\n * })\n */\n public pairingStatus(\n request: SmoothAgentApi.PairingStatusMachinesRequest,\n requestOptions?: MachinesClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.Pairing> {\n return core.HttpResponsePromise.fromPromise(this.__pairingStatus(request, requestOptions));\n }\n\n private async __pairingStatus(\n request: SmoothAgentApi.PairingStatusMachinesRequest,\n requestOptions?: MachinesClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.Pairing>> {\n const { code } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `machines/pairings/${core.url.encodePathParam(code, errors.SmoothAgentApiError)}`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.Pairing, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/machines/pairings/{code}\");\n }\n\n /**\n * @param {SmoothAgentApi.MachinesGetRequest} request\n * @param {MachinesClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.machines.get({\n * id: \"id\"\n * })\n */\n public get(\n request: SmoothAgentApi.MachinesGetRequest,\n requestOptions?: MachinesClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.Machine> {\n return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));\n }\n\n private async __get(\n request: SmoothAgentApi.MachinesGetRequest,\n requestOptions?: MachinesClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.Machine>> {\n const { id } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `machines/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.Machine, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/machines/{id}\");\n }\n\n /**\n * cloud: apaga inst\u00E2ncia + volume (recusa com `conflict` se tem run vivo). local: despareia e revoga o token do runner.\n *\n * @param {SmoothAgentApi.MachinesDeleteRequest} request\n * @param {MachinesClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.machines.delete({\n * id: \"id\"\n * })\n */\n public delete(\n request: SmoothAgentApi.MachinesDeleteRequest,\n requestOptions?: MachinesClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.Deleted> {\n return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));\n }\n\n private async __delete(\n request: SmoothAgentApi.MachinesDeleteRequest,\n requestOptions?: MachinesClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.Deleted>> {\n const { id } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `machines/${core.url.encodePathParam(id, errors.SmoothAgentApiError)}`,\n ),\n method: \"DELETE\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.Deleted, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"DELETE\", \"/machines/{id}\");\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport type { BaseClientOptions, BaseRequestOptions } from \"../../../../BaseClient.js\";\nimport { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from \"../../../../BaseClient.js\";\nimport { mergeHeaders, mergeOnlyDefinedHeaders } from \"../../../../core/headers.js\";\nimport * as core from \"../../../../core/index.js\";\nimport { mergeAdditionalBodyParameters } from \"../../../../core/requestBody.js\";\nimport * as environments from \"../../../../environments.js\";\nimport { handleNonStatusCodeError } from \"../../../../errors/handleNonStatusCodeError.js\";\nimport * as errors from \"../../../../errors/index.js\";\nimport * as SmoothAgentApi from \"../../../index.js\";\n\nexport declare namespace ProvidersClient {\n export type Options = BaseClientOptions;\n\n export interface RequestOptions extends BaseRequestOptions {}\n}\n\nexport class ProvidersClient {\n protected readonly _options: NormalizedClientOptionsWithAuth<ProvidersClient.Options>;\n\n constructor(options: ProvidersClient.Options) {\n this._options = normalizeClientOptionsWithAuth(options);\n }\n\n /**\n * @param {SmoothAgentApi.MyProvidersListRequest} request\n * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.providers.myProvidersList()\n */\n public myProvidersList(\n request: SmoothAgentApi.MyProvidersListRequest = {},\n requestOptions?: ProvidersClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.MyProvidersListResponse> {\n return core.HttpResponsePromise.fromPromise(this.__myProvidersList(request, requestOptions));\n }\n\n private async __myProvidersList(\n request: SmoothAgentApi.MyProvidersListRequest = {},\n requestOptions?: ProvidersClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.MyProvidersListResponse>> {\n const { \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n \"me/providers\",\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return {\n data: _response.body as SmoothAgentApi.MyProvidersListResponse,\n rawResponse: _response.rawResponse,\n };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"GET\", \"/me/providers\");\n }\n\n /**\n * Poll do device flow (a box avisa quando capturou o auth.json).\n *\n * @param {SmoothAgentApi.MyProvidersLoginStatusRequest} request\n * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.providers.myProvidersLoginStatus({\n * loginId: \"loginId\"\n * })\n */\n public myProvidersLoginStatus(\n request: SmoothAgentApi.MyProvidersLoginStatusRequest,\n requestOptions?: ProvidersClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.LoginStatus> {\n return core.HttpResponsePromise.fromPromise(this.__myProvidersLoginStatus(request, requestOptions));\n }\n\n private async __myProvidersLoginStatus(\n request: SmoothAgentApi.MyProvidersLoginStatusRequest,\n requestOptions?: ProvidersClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.LoginStatus>> {\n const { loginId, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `me/providers/logins/${core.url.encodePathParam(loginId, errors.SmoothAgentApiError)}`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.LoginStatus, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(\n _response.error,\n _response.rawResponse,\n \"GET\",\n \"/me/providers/logins/{loginId}\",\n );\n }\n\n /**\n * S\u00F3 OAuth: o c\u00F3digo colado pelo usu\u00E1rio.\n *\n * @param {SmoothAgentApi.MyProvidersCompleteRequest} request\n * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.providers.myProvidersComplete({\n * loginId: \"loginId\",\n * code: \"code\"\n * })\n */\n public myProvidersComplete(\n request: SmoothAgentApi.MyProvidersCompleteRequest,\n requestOptions?: ProvidersClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.ProviderStatus> {\n return core.HttpResponsePromise.fromPromise(this.__myProvidersComplete(request, requestOptions));\n }\n\n private async __myProvidersComplete(\n request: SmoothAgentApi.MyProvidersCompleteRequest,\n requestOptions?: ProvidersClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ProviderStatus>> {\n const {\n loginId,\n \"SmoothAgent-As-User\": smoothAgentAsUser,\n \"Idempotency-Key\": idempotencyKey,\n ..._body\n } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `me/providers/logins/${core.url.encodePathParam(loginId, errors.SmoothAgentApiError)}/complete`,\n ),\n method: \"POST\",\n headers: _headers,\n contentType: \"application/json\",\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n requestType: \"json\",\n body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.ProviderStatus, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(\n _response.error,\n _response.rawResponse,\n \"POST\",\n \"/me/providers/logins/{loginId}/complete\",\n );\n }\n\n /**\n * @param {SmoothAgentApi.MyProvidersDisconnectRequest} request\n * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.providers.myProvidersDisconnect({\n * provider: \"claude\"\n * })\n */\n public myProvidersDisconnect(\n request: SmoothAgentApi.MyProvidersDisconnectRequest,\n requestOptions?: ProvidersClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.ProviderStatus> {\n return core.HttpResponsePromise.fromPromise(this.__myProvidersDisconnect(request, requestOptions));\n }\n\n private async __myProvidersDisconnect(\n request: SmoothAgentApi.MyProvidersDisconnectRequest,\n requestOptions?: ProvidersClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ProviderStatus>> {\n const { provider, via, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _queryParams: Record<string, unknown> = {\n via: via != null ? via : undefined,\n };\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `me/providers/${core.url.encodePathParam(provider, errors.SmoothAgentApiError)}`,\n ),\n method: \"DELETE\",\n headers: _headers,\n queryString: core.url\n .queryBuilder()\n .addMany(_queryParams)\n .add(\"via\", _queryParams.via, { style: \"comma\" })\n .mergeAdditional(requestOptions?.queryParams)\n .build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.ProviderStatus, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"DELETE\", \"/me/providers/{provider}\");\n }\n\n /**\n * Abre o fluxo. Claude \u2192 `oauth`; Codex \u2192 `device`.\n *\n * @param {SmoothAgentApi.MyProvidersConnectRequest} request\n * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.providers.myProvidersConnect({\n * provider: \"claude\"\n * })\n */\n public myProvidersConnect(\n request: SmoothAgentApi.MyProvidersConnectRequest,\n requestOptions?: ProvidersClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.MyProvidersConnectResponse> {\n return core.HttpResponsePromise.fromPromise(this.__myProvidersConnect(request, requestOptions));\n }\n\n private async __myProvidersConnect(\n request: SmoothAgentApi.MyProvidersConnectRequest,\n requestOptions?: ProvidersClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.MyProvidersConnectResponse>> {\n const { provider, \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser, \"Idempotency-Key\": idempotencyKey }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `me/providers/${core.url.encodePathParam(provider, errors.SmoothAgentApiError)}/connect`,\n ),\n method: \"POST\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return {\n data: _response.body as SmoothAgentApi.MyProvidersConnectResponse,\n rawResponse: _response.rawResponse,\n };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(\n _response.error,\n _response.rawResponse,\n \"POST\",\n \"/me/providers/{provider}/connect\",\n );\n }\n\n /**\n * Chave pr\u00F3pria. Validada pelo prefixo E por uma chamada barata ao provedor.\n *\n * @param {SmoothAgentApi.MyProvidersSetKeyRequest} request\n * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.providers.myProvidersSetKey({\n * provider: \"claude\",\n * key: \"key\"\n * })\n */\n public myProvidersSetKey(\n request: SmoothAgentApi.MyProvidersSetKeyRequest,\n requestOptions?: ProvidersClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.ProviderStatus> {\n return core.HttpResponsePromise.fromPromise(this.__myProvidersSetKey(request, requestOptions));\n }\n\n private async __myProvidersSetKey(\n request: SmoothAgentApi.MyProvidersSetKeyRequest,\n requestOptions?: ProvidersClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ProviderStatus>> {\n const { provider, \"SmoothAgent-As-User\": smoothAgentAsUser, ..._body } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `me/providers/${core.url.encodePathParam(provider, errors.SmoothAgentApiError)}/key`,\n ),\n method: \"PUT\",\n headers: _headers,\n contentType: \"application/json\",\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n requestType: \"json\",\n body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.ProviderStatus, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(_response.error, _response.rawResponse, \"PUT\", \"/me/providers/{provider}/key\");\n }\n\n /**\n * Janelas de uso da assinatura/chave (o que o provedor informa; ausente nunca \u00E9 estimado).\n *\n * @param {SmoothAgentApi.MyProvidersLimitsRequest} request\n * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link SmoothAgentApi.BadRequestError}\n * @throws {@link SmoothAgentApi.UnauthorizedError}\n * @throws {@link SmoothAgentApi.PaymentRequiredError}\n * @throws {@link SmoothAgentApi.ForbiddenError}\n * @throws {@link SmoothAgentApi.NotFoundError}\n * @throws {@link SmoothAgentApi.ConflictError}\n * @throws {@link SmoothAgentApi.GoneError}\n * @throws {@link SmoothAgentApi.UnprocessableEntityError}\n * @throws {@link SmoothAgentApi.FailedDependencyError}\n * @throws {@link SmoothAgentApi.TooManyRequestsError}\n * @throws {@link SmoothAgentApi.InternalServerError}\n * @throws {@link SmoothAgentApi.BadGatewayError}\n * @throws {@link SmoothAgentApi.ServiceUnavailableError}\n * @throws {@link errors.SmoothAgentApiError}\n * @throws {@link errors.SmoothAgentApiTimeoutError}\n *\n * @example\n * await client.providers.myProvidersLimits({\n * provider: \"claude\"\n * })\n */\n public myProvidersLimits(\n request: SmoothAgentApi.MyProvidersLimitsRequest,\n requestOptions?: ProvidersClient.RequestOptions,\n ): core.HttpResponsePromise<SmoothAgentApi.ProviderLimits> {\n return core.HttpResponsePromise.fromPromise(this.__myProvidersLimits(request, requestOptions));\n }\n\n private async __myProvidersLimits(\n request: SmoothAgentApi.MyProvidersLimitsRequest,\n requestOptions?: ProvidersClient.RequestOptions,\n ): Promise<core.WithRawResponse<SmoothAgentApi.ProviderLimits>> {\n const { provider, \"SmoothAgent-As-User\": smoothAgentAsUser } = request;\n const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();\n const _headers: core.Fetcher.Args[\"headers\"] = mergeHeaders(\n _authRequest.headers,\n this._options?.headers,\n mergeOnlyDefinedHeaders({ \"SmoothAgent-As-User\": smoothAgentAsUser }),\n requestOptions?.headers,\n );\n const _response = await core.fetcher({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.SmoothAgentApiEnvironment.Default,\n `me/providers/${core.url.encodePathParam(provider, errors.SmoothAgentApiError)}/limits`,\n ),\n method: \"GET\",\n headers: _headers,\n queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),\n timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,\n maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n fetchFn: this._options?.fetch,\n logging: this._options.logging,\n });\n if (_response.ok) {\n return { data: _response.body as SmoothAgentApi.ProviderLimits, rawResponse: _response.rawResponse };\n }\n\n if (_response.error.reason === \"status-code\") {\n switch (_response.error.statusCode) {\n case 400:\n throw new SmoothAgentApi.BadRequestError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 401:\n throw new SmoothAgentApi.UnauthorizedError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 402:\n throw new SmoothAgentApi.PaymentRequiredError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 403:\n throw new SmoothAgentApi.ForbiddenError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 404:\n throw new SmoothAgentApi.NotFoundError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 409:\n throw new SmoothAgentApi.ConflictError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 410:\n throw new SmoothAgentApi.GoneError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 422:\n throw new SmoothAgentApi.UnprocessableEntityError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 424:\n throw new SmoothAgentApi.FailedDependencyError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 429:\n throw new SmoothAgentApi.TooManyRequestsError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 500:\n throw new SmoothAgentApi.InternalServerError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 502:\n throw new SmoothAgentApi.BadGatewayError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n case 503:\n throw new SmoothAgentApi.ServiceUnavailableError(\n _response.error.body as SmoothAgentApi.Error_,\n _response.rawResponse,\n );\n default:\n throw new errors.SmoothAgentApiError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n return handleNonStatusCodeError(\n _response.error,\n _response.rawResponse,\n \"GET\",\n \"/me/providers/{provider}/limits\",\n );\n }\n}\n", "// This file was auto-generated by Fern from our API Definition.\n\nimport { AgentsClient } from \"./api/resources/agents/client/Client.js\";\nimport { ChatsClient } from \"./api/resources/chats/client/Client.js\";\nimport { FilesClient } from \"./api/resources/files/client/Client.js\";\nimport { IdentityClient } from \"./api/resources/identity/client/Client.js\";\nimport { MachinesClient } from \"./api/resources/machines/client/Client.js\";\nimport { ProvidersClient } from \"./api/resources/providers/client/Client.js\";\nimport type { BaseClientOptions, BaseRequestOptions } from \"./BaseClient.js\";\nimport { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from \"./BaseClient.js\";\nimport * as core from \"./core/index.js\";\n\nexport declare namespace SmoothAgentApiClient {\n export type Options = BaseClientOptions;\n\n export interface RequestOptions extends BaseRequestOptions {}\n}\n\nexport class SmoothAgentApiClient {\n protected readonly _options: NormalizedClientOptionsWithAuth<SmoothAgentApiClient.Options>;\n protected _agents: AgentsClient | undefined;\n protected _chats: ChatsClient | undefined;\n protected _files: FilesClient | undefined;\n protected _machines: MachinesClient | undefined;\n protected _identity: IdentityClient | undefined;\n protected _providers: ProvidersClient | undefined;\n\n constructor(options: SmoothAgentApiClient.Options) {\n this._options = normalizeClientOptionsWithAuth(options);\n }\n\n public get agents(): AgentsClient {\n return (this._agents ??= new AgentsClient(this._options));\n }\n\n public get chats(): ChatsClient {\n return (this._chats ??= new ChatsClient(this._options));\n }\n\n public get files(): FilesClient {\n return (this._files ??= new FilesClient(this._options));\n }\n\n public get machines(): MachinesClient {\n return (this._machines ??= new MachinesClient(this._options));\n }\n\n public get identity(): IdentityClient {\n return (this._identity ??= new IdentityClient(this._options));\n }\n\n public get providers(): ProvidersClient {\n return (this._providers ??= new ProvidersClient(this._options));\n }\n\n /**\n * Make a passthrough request using the SDK's configured auth, retry, logging, etc.\n * This is useful for making requests to endpoints not yet supported in the SDK.\n * The input can be a URL string, URL object, or Request object. Relative paths are resolved against the configured base URL.\n *\n * @param {Request | string | URL} input - The URL, path, or Request object.\n * @param {RequestInit} init - Standard fetch RequestInit options.\n * @param {core.PassthroughRequest.RequestOptions} requestOptions - Per-request overrides (timeout, retries, headers, abort signal).\n * @returns {Promise<Response>} A standard Response object.\n */\n public async fetch(\n input: Request | string | URL,\n init?: RequestInit,\n requestOptions?: core.PassthroughRequest.RequestOptions,\n ): Promise<Response> {\n return core.makePassthroughRequest(\n input,\n init,\n {\n baseUrl: this._options.baseUrl ?? this._options.environment,\n headers: this._options.headers,\n timeoutInSeconds: this._options.timeoutInSeconds,\n maxRetries: this._options.maxRetries,\n fetch: this._options.fetch,\n logging: this._options.logging,\n getAuthHeaders: async () => (await this._options.authProvider.getAuthRequest()).headers,\n },\n requestOptions,\n );\n }\n}\n", "import * as logger from \"./logger.js\";\n\nexport namespace logging {\n /**\n * Configuration for logger instances.\n */\n export type LogConfig = logger.LogConfig;\n export type LogLevel = logger.LogLevel;\n export const LogLevel: typeof logger.LogLevel = logger.LogLevel;\n export type ILogger = logger.ILogger;\n /**\n * Console logger implementation that outputs to the console.\n */\n export type ConsoleLogger = logger.ConsoleLogger;\n /**\n * Console logger implementation that outputs to the console.\n */\n export const ConsoleLogger: typeof logger.ConsoleLogger = logger.ConsoleLogger;\n}\n", "// Token do usu\u00E1rio (DESIGN \u00A71.1; proposta sdk \u00A74.7; control \u00A72.2):\n// - `getToken` \u00E9 single-flight: N chamadas concorrentes = UMA renova\u00E7\u00E3o no backend do dev;\n// - renova ANTES de vencer (o JWT \u00E9 leg\u00EDvel: `exp`), com folga;\n// - REST com 401 {reason:'expired'} \u2192 renova e repete UMA vez; 'revoked' \u2192 para (a sess\u00E3o acabou);\n// - token novo tamb\u00E9m vai pros sockets abertos (`onRenew`), sem derrubar nada.\nimport type { Clock } from './deps'\n\nexport type AuthErrorReason = 'missing' | 'invalid' | 'expired' | 'revoked'\n\nexport class SmoothAgentAuthError extends Error {\n constructor(\n readonly reason: AuthErrorReason,\n message = `unauthorized (${reason})`,\n ) {\n super(message)\n this.name = 'SmoothAgentAuthError'\n }\n}\n\nexport interface TokenSourceOptions {\n token?: string\n getToken?: () => Promise<string>\n clock: Clock\n /** Renova quando falta menos que isto pro `exp` (padr\u00E3o 60 s). */\n skewMs?: number\n}\n\n/** `exp` (ms) de um JWT, ou null se n\u00E3o for JWT (chave de API) ou n\u00E3o tiver `exp`. */\nexport function jwtExpiresAt(token: string): number | null {\n const part = token.split('.')[1]\n if (!part) return null\n try {\n const json = JSON.parse(decodeBase64Url(part)) as { exp?: unknown }\n return typeof json.exp === 'number' ? json.exp * 1000 : null\n } catch {\n return null\n }\n}\n\nfunction decodeBase64Url(s: string): string {\n const b64 = s.replace(/-/g, '+').replace(/_/g, '/') + '==='.slice((s.length + 3) % 4)\n if (typeof atob === 'function') {\n const bin = atob(b64)\n const bytes = Uint8Array.from(bin, (c) => c.charCodeAt(0))\n return new TextDecoder().decode(bytes)\n }\n return Buffer.from(b64, 'base64').toString('utf8')\n}\n\nexport class TokenSource {\n private current: string | null\n private inflight: Promise<string> | null = null\n private stale = false\n private revoked = false\n private readonly listeners = new Set<(token: string) => void>()\n private readonly skewMs: number\n\n constructor(private readonly o: TokenSourceOptions) {\n if (!o.token && !o.getToken) throw new Error('SmoothAgent: passe `token` ou `getToken`')\n this.current = o.token ?? null\n this.skewMs = o.skewMs ?? 60_000\n }\n\n /** Token v\u00E1lido agora (renova se precisar). Rejeita com SmoothAgentAuthError('revoked') depois de revogado. */\n async get(): Promise<string> {\n if (this.revoked) throw new SmoothAgentAuthError('revoked')\n if (this.current && !this.stale && !this.nearExpiry(this.current)) return this.current\n if (!this.o.getToken) {\n if (this.current && !this.stale) return this.current // sem como renovar: usa o que tem\n throw new SmoothAgentAuthError('expired')\n }\n return this.refresh()\n }\n\n /** O servidor disse `expired`: a pr\u00F3xima `get()` renova. */\n invalidate(): void {\n this.stale = true\n }\n\n /** O servidor disse `revoked`: nada de renovar. */\n markRevoked(): void {\n this.revoked = true\n }\n\n get isRevoked(): boolean {\n return this.revoked\n }\n\n onRenew(cb: (token: string) => void): () => void {\n this.listeners.add(cb)\n return () => this.listeners.delete(cb)\n }\n\n private nearExpiry(token: string): boolean {\n const exp = jwtExpiresAt(token)\n return exp !== null && exp - this.o.clock.now() < this.skewMs\n }\n\n private refresh(): Promise<string> {\n if (this.inflight) return this.inflight\n const prev = this.current\n this.inflight = this.o.getToken!()\n .then((t) => {\n this.current = t\n this.stale = false\n if (t !== prev) for (const l of this.listeners) l(t)\n return t\n })\n .finally(() => {\n this.inflight = null\n })\n return this.inflight\n }\n}\n\n/**\n * `fetch` com o Authorization do TokenSource e a regra do 401: `expired` \u2192 renova e repete UMA vez;\n * `revoked` \u2192 marca e devolve a resposta (quem chamou mostra o erro). Vai como `fetch` da SDK gerada.\n */\nexport function authedFetch(source: TokenSource, base: typeof fetch = fetch): typeof fetch {\n return async (input, init) => {\n const call = async (token: string) => {\n const headers = new Headers(init?.headers)\n headers.set('Authorization', `Bearer ${token}`)\n return base(input, { ...init, headers })\n }\n let res = await call(await source.get())\n if (res.status !== 401) return res\n const reason = await reasonOf(res)\n if (reason === 'revoked') {\n source.markRevoked()\n return res\n }\n if (reason !== 'expired') return res\n source.invalidate()\n res = await call(await source.get())\n if (res.status === 401 && (await reasonOf(res)) === 'revoked') source.markRevoked()\n return res\n }\n}\n\nasync function reasonOf(res: Response): Promise<AuthErrorReason | undefined> {\n try {\n const body = (await res.clone().json()) as { error?: { details?: { reason?: AuthErrorReason } } }\n return body.error?.details?.reason\n } catch {\n return undefined\n }\n}\n", "// O que a camada ao vivo recebe de fora (proposta sdk \u00A75). Nada aqui conhece o c\u00F3digo gerado:\n// trocar de gerador = reescrever a cola que monta estas depend\u00EAncias.\nimport type { ChatSnapshot, Envelope } from './types'\n\n/** O m\u00EDnimo de um WebSocket (browser, React Native, Node \u2265 22, Bun, Deno ou um falso de teste). */\nexport interface SocketLike {\n readonly readyState: number // 0 CONNECTING \u00B7 1 OPEN \u00B7 2 CLOSING \u00B7 3 CLOSED\n send(data: string): void\n close(code?: number, reason?: string): void\n onopen: ((ev?: unknown) => void) | null\n onmessage: ((ev: { data: unknown }) => void) | null\n onclose: ((ev: { code: number; reason: string }) => void) | null\n onerror: ((ev?: unknown) => void) | null\n}\n\nexport type OpenSocket = (url: string, protocols: string[]) => SocketLike\n\nexport interface Clock {\n now(): number\n setTimeout(fn: () => void, ms: number): unknown\n clearTimeout(handle: unknown): void\n}\n\nexport interface LiveEnv {\n /** false = sabemos que n\u00E3o h\u00E1 rede (navigator.onLine). */\n online(): boolean\n /** Primeiro plano? (visibilitychange / AppState). Muda o teto do backoff. */\n visible(): boolean\n /** Rede voltou, aba voltou pro primeiro plano, foco: acorda o retry na hora. Devolve o \"desligar\". */\n onWake(cb: (why: 'online' | 'visible' | 'focus' | 'manual', awayMs?: number) => void): () => void\n}\n\nexport interface LiveDeps {\n /** URL do conector (o WebSocket do ChatLog): `wss://\u2026/v3/chats/:id/live`. */\n connectorUrl(chatId: string): string\n openSocket: OpenSocket\n /** Token do usu\u00E1rio (ou chave), j\u00E1 com a renova\u00E7\u00E3o single-flight (auth.ts). */\n token(): Promise<string>\n /** O servidor disse que o token venceu: a pr\u00F3xima `token()` tem que trazer um novo. */\n invalidateToken?(): void\n /** Peda\u00E7o do log por REST, quando n\u00E3o h\u00E1 socket que responda o `fetch`. */\n eventsRange?(chatId: string, from: number, to: number): Promise<{ events: Envelope[]; range: { from: number; to: number } }>\n /**\n * O WebSocket n\u00E3o mostra o HTTP de um upgrade recusado (o navegador s\u00F3 d\u00E1 1006). Quando o conector nem\n * chega a abrir, a SDK pergunta aqui (REST `GET /chats/{id}`) se \u00E9 falta de acesso, pra n\u00E3o religar pra sempre.\n */\n probeAccess?(chatId: string): Promise<'ok' | 'unauthorized' | 'forbidden'>\n /** Snapshot por REST (resync sem socket). */\n snapshot?(chatId: string): Promise<ChatSnapshot>\n clock: Clock\n env: LiveEnv\n}\n\nexport const PROTOCOL = 'smoothagent.v3'\n\n/** A auto-resposta hibern\u00E1vel do DO compara a STRING EXATA (realtime: PING/PONG). Qualquer outra forma acorda o DO. */\nexport const PING = '{\"t\":\"ping\"}'\nexport const PONG = '{\"t\":\"pong\"}'\n\nexport const systemClock: Clock = {\n now: () => Date.now(),\n setTimeout: (fn, ms) => setTimeout(fn, ms),\n clearTimeout: (h) => clearTimeout(h as ReturnType<typeof setTimeout>),\n}\n\n/** Ambiente neutro (Node/servidor): sempre online e vis\u00EDvel, sem eventos de wakeup. */\nexport const serverEnv: LiveEnv = {\n online: () => true,\n visible: () => true,\n onWake: () => () => {},\n}\n", "let wasm;\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nconst heap = new Array(128).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nlet heap_next = heap.length;\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nconst cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nfunction getObject(idx) { return heap[idx]; }\n\nfunction dropObject(idx) {\n if (idx < 132) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n/**\n * @param {number} epoch\n * @param {number} now\n * @returns {number}\n */\nexport function to_ms(epoch, now) {\n const ret = wasm.to_ms(epoch, now);\n return ret;\n}\n\n/**\n * @param {string} c\n * @returns {string}\n */\nexport function error_code(c) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(c, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.error_code(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n}\n\n/**\n * A lista fechada do contrato (\u00A76), gerada do schema no build.\n * @returns {string}\n */\nexport function error_codes() {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.error_codes(retptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n}\n\n/**\n * `state.needsProvider` a partir do estado (o mesmo do watch; a fixture de conformidade usa).\n * @param {string} timeline_json\n * @param {string} queue_json\n * @param {string} refusal_json\n * @returns {string}\n */\nexport function needs_provider(timeline_json, queue_json, refusal_json) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(timeline_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(queue_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(refusal_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.needs_provider(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n}\n\nconst LiveFeedFinalization = (typeof FinalizationRegistry === 'undefined')\n ? { register: () => {}, unregister: () => {} }\n : new FinalizationRegistry(ptr => wasm.__wbg_livefeed_free(ptr >>> 0, 1));\n/**\n * A lista lateral ao vivo (UserFeed). As entradas s\u00E3o as mesmas da borda comum; as que n\u00E3o se aplicam\n * (probe, range, snapshot) n\u00E3o fazem nada.\n */\nexport class LiveFeed {\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n LiveFeedFinalization.unregister(this);\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_livefeed_free(ptr, 0);\n }\n /**\n * `config_json`: { url, agentId?, backoff? }\n * @param {string} config_json\n */\n constructor(config_json) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(config_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livefeed_new(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n this.__wbg_ptr = r0 >>> 0;\n LiveFeedFinalization.register(this, this.__wbg_ptr, this);\n return this;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @returns {string}\n */\n start(now, online, visible, rand) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livefeed_start(retptr, this.__wbg_ptr, now, online, visible, rand);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {string} _why\n * @param {number} _away_ms\n * @returns {string}\n */\n wake(now, online, visible, rand, _why, _away_ms) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(_why, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livefeed_wake(retptr, this.__wbg_ptr, now, online, visible, rand, ptr0, len0, _away_ms);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @returns {string}\n */\n close(now, online, visible, rand) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livefeed_close(retptr, this.__wbg_ptr, now, online, visible, rand);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @returns {string}\n */\n tick(now, online, visible, rand) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livefeed_tick(retptr, this.__wbg_ptr, now, online, visible, rand);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} conn\n * @returns {string}\n */\n on_open(now, online, visible, rand, conn) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livefeed_on_open(retptr, this.__wbg_ptr, now, online, visible, rand, conn);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} conn\n * @param {string} text\n * @returns {string}\n */\n on_message(now, online, visible, rand, conn, text) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livefeed_on_message(retptr, this.__wbg_ptr, now, online, visible, rand, conn, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} _now\n * @param {boolean} _online\n * @param {boolean} _visible\n * @param {number} _rand\n * @param {number} _conn\n * @returns {string}\n */\n on_error(_now, _online, _visible, _rand, _conn) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livefeed_on_error(retptr, this.__wbg_ptr, _now, _online, _visible, _rand, _conn);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} conn\n * @param {number} code\n * @param {string} reason\n * @returns {string}\n */\n on_close(now, online, visible, rand, conn, code, reason) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(reason, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livefeed_on_close(retptr, this.__wbg_ptr, now, online, visible, rand, conn, code, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} conn\n * @returns {string}\n */\n on_open_failed(now, online, visible, rand, conn) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livefeed_on_open_failed(retptr, this.__wbg_ptr, now, online, visible, rand, conn);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} req\n * @param {boolean} ok\n * @param {string} token\n * @returns {string}\n */\n on_token(now, online, visible, rand, req, ok, token) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livefeed_on_token(retptr, this.__wbg_ptr, now, online, visible, rand, req, ok, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} _n\n * @param {boolean} _o\n * @param {boolean} _v\n * @param {number} _r\n * @param {number} _req\n * @param {boolean} _ok\n * @param {string} _a\n * @returns {string}\n */\n on_probe(_n, _o, _v, _r, _req, _ok, _a) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(_a, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livefeed_on_probe(retptr, this.__wbg_ptr, _n, _o, _v, _r, _req, _ok, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} _n\n * @param {boolean} _o\n * @param {boolean} _v\n * @param {number} _r\n * @param {number} _req\n * @param {boolean} _ok\n * @param {string} _e\n * @param {number} _f\n * @param {number} _t\n * @returns {string}\n */\n on_range(_n, _o, _v, _r, _req, _ok, _e, _f, _t) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(_e, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livefeed_on_range(retptr, this.__wbg_ptr, _n, _o, _v, _r, _req, _ok, ptr0, len0, _f, _t);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} _n\n * @param {boolean} _o\n * @param {boolean} _v\n * @param {number} _r\n * @param {number} _req\n * @param {boolean} _ok\n * @param {string} _s\n * @returns {string}\n */\n on_snapshot(_n, _o, _v, _r, _req, _ok, _s) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(_s, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livefeed_on_probe(retptr, this.__wbg_ptr, _n, _o, _v, _r, _req, _ok, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @returns {string}\n */\n status() {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livefeed_status(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @returns {number}\n */\n next_deadline() {\n const ret = wasm.livefeed_next_deadline(this.__wbg_ptr);\n return ret;\n }\n}\n\nconst LiveSessionFinalization = (typeof FinalizationRegistry === 'undefined')\n ? { register: () => {}, unregister: () => {} }\n : new FinalizationRegistry(ptr => wasm.__wbg_livesession_free(ptr >>> 0, 1));\n/**\n * Uma sess\u00E3o ao vivo de um chat (o `ChatStream`). Toda entrada recebe o ambiente do instante e devolve\n * os efeitos (JSON array) que a borda executa em ordem.\n */\nexport class LiveSession {\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n LiveSessionFinalization.unregister(this);\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_livesession_free(ptr, 0);\n }\n /**\n * `config_json`: { chatId, connectorUrl, resumeCursor?, resumeInboxVersion?, includeRaw?, strict?,\n * pingEveryMs?, pongTimeoutMs?, switchGraceMs?, syncTimeoutMs?, gapTimeoutMs?,\n * longAwayMs?, backoff?{\u2026}, has:{probeAccess,eventsRange,snapshot} }\n * @param {string} config_json\n */\n constructor(config_json) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(config_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livesession_new(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n this.__wbg_ptr = r0 >>> 0;\n LiveSessionFinalization.register(this, this.__wbg_ptr, this);\n return this;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @returns {string}\n */\n start(now, online, visible, rand) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livesession_start(retptr, this.__wbg_ptr, now, online, visible, rand);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {string} frame_json\n * @returns {string}\n */\n command(now, online, visible, rand, frame_json) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(frame_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livesession_command(retptr, this.__wbg_ptr, now, online, visible, rand, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0; len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {string} token\n * @returns {string}\n */\n token_renewed(now, online, visible, rand, token) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livesession_token_renewed(retptr, this.__wbg_ptr, now, online, visible, rand, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {string} why\n * @param {number} away_ms\n * @returns {string}\n */\n wake(now, online, visible, rand, why, away_ms) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(why, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livesession_wake(retptr, this.__wbg_ptr, now, online, visible, rand, ptr0, len0, away_ms);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @returns {string}\n */\n close(now, online, visible, rand) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livesession_close(retptr, this.__wbg_ptr, now, online, visible, rand);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @returns {string}\n */\n tick(now, online, visible, rand) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livesession_tick(retptr, this.__wbg_ptr, now, online, visible, rand);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} conn\n * @returns {string}\n */\n on_open(now, online, visible, rand, conn) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livesession_on_open(retptr, this.__wbg_ptr, now, online, visible, rand, conn);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} conn\n * @param {string} text\n * @returns {string}\n */\n on_message(now, online, visible, rand, conn, text) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livesession_on_message(retptr, this.__wbg_ptr, now, online, visible, rand, conn, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} conn\n * @returns {string}\n */\n on_error(now, online, visible, rand, conn) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livesession_on_error(retptr, this.__wbg_ptr, now, online, visible, rand, conn);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} conn\n * @param {number} code\n * @param {string} reason\n * @returns {string}\n */\n on_close(now, online, visible, rand, conn, code, reason) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(reason, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livesession_on_close(retptr, this.__wbg_ptr, now, online, visible, rand, conn, code, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} conn\n * @returns {string}\n */\n on_open_failed(now, online, visible, rand, conn) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livesession_on_open_failed(retptr, this.__wbg_ptr, now, online, visible, rand, conn);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * `ok=false` = o getToken falhou.\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} req\n * @param {boolean} ok\n * @param {string} token\n * @returns {string}\n */\n on_token(now, online, visible, rand, req, ok, token) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livesession_on_token(retptr, this.__wbg_ptr, now, online, visible, rand, req, ok, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} req\n * @param {boolean} ok\n * @param {string} access\n * @returns {string}\n */\n on_probe(now, online, visible, rand, req, ok, access) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(access, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livesession_on_probe(retptr, this.__wbg_ptr, now, online, visible, rand, req, ok, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * `events_json` = array de envelopes.\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} req\n * @param {boolean} ok\n * @param {string} events_json\n * @param {number} from\n * @param {number} to\n * @returns {string}\n */\n on_range(now, online, visible, rand, req, ok, events_json, from, to) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(events_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livesession_on_range(retptr, this.__wbg_ptr, now, online, visible, rand, req, ok, ptr0, len0, from, to);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} req\n * @param {boolean} ok\n * @param {string} snapshot_json\n * @returns {string}\n */\n on_snapshot(now, online, visible, rand, req, ok, snapshot_json) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(snapshot_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livesession_on_snapshot(retptr, this.__wbg_ptr, now, online, visible, rand, req, ok, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @returns {string}\n */\n status() {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livesession_status(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @returns {number}\n */\n cursor() {\n const ret = wasm.livesession_cursor(this.__wbg_ptr);\n return ret;\n }\n /**\n * \"connector\" | \"box\" | \"\" (nenhum)\n * @returns {string}\n */\n via() {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livesession_via(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * JSON da presen\u00E7a da box ou \"\".\n * @returns {string}\n */\n box_presence() {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livesession_box_presence(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * Pr\u00F3ximo prazo (ms) ou -1.\n * @returns {number}\n */\n next_deadline() {\n const ret = wasm.livesession_next_deadline(this.__wbg_ptr);\n return ret;\n }\n}\n\nconst LiveWatchFinalization = (typeof FinalizationRegistry === 'undefined')\n ? { register: () => {}, unregister: () => {} }\n : new FinalizationRegistry(ptr => wasm.__wbg_livewatch_free(ptr >>> 0, 1));\n/**\n * O `watch()` inteiro (transporte + estado + hist\u00F3rico + otimista). Efeitos = os da sess\u00E3o + `history`\n * (pedir p\u00E1gina), `patch` (o que mudou no estado) e `tap` (eventos aplicados).\n */\nexport class LiveWatch {\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n LiveWatchFinalization.unregister(this);\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_livewatch_free(ptr, 0);\n }\n /**\n * A mesma configura\u00E7\u00E3o da `LiveSession` + `pageSize?`, `maxWindow?`, `has.history`.\n * @param {string} config_json\n */\n constructor(config_json) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(config_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livewatch_new(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n this.__wbg_ptr = r0 >>> 0;\n LiveWatchFinalization.register(this, this.__wbg_ptr, this);\n return this;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @returns {string}\n */\n start(now, online, visible, rand) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livewatch_start(retptr, this.__wbg_ptr, now, online, visible, rand);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @returns {string}\n */\n tick(now, online, visible, rand) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livewatch_tick(retptr, this.__wbg_ptr, now, online, visible, rand);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {string} why\n * @param {number} away_ms\n * @returns {string}\n */\n wake(now, online, visible, rand, why, away_ms) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(why, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livewatch_wake(retptr, this.__wbg_ptr, now, online, visible, rand, ptr0, len0, away_ms);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @returns {string}\n */\n close(now, online, visible, rand) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livewatch_close(retptr, this.__wbg_ptr, now, online, visible, rand);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {string} token\n * @returns {string}\n */\n token_renewed(now, online, visible, rand, token) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livewatch_token_renewed(retptr, this.__wbg_ptr, now, online, visible, rand, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} conn\n * @returns {string}\n */\n on_open(now, online, visible, rand, conn) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livewatch_on_open(retptr, this.__wbg_ptr, now, online, visible, rand, conn);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} conn\n * @param {string} text\n * @returns {string}\n */\n on_message(now, online, visible, rand, conn, text) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livewatch_on_message(retptr, this.__wbg_ptr, now, online, visible, rand, conn, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} conn\n * @returns {string}\n */\n on_error(now, online, visible, rand, conn) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livewatch_on_error(retptr, this.__wbg_ptr, now, online, visible, rand, conn);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} conn\n * @param {number} code\n * @param {string} reason\n * @returns {string}\n */\n on_close(now, online, visible, rand, conn, code, reason) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(reason, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livewatch_on_close(retptr, this.__wbg_ptr, now, online, visible, rand, conn, code, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} conn\n * @returns {string}\n */\n on_open_failed(now, online, visible, rand, conn) {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livewatch_on_open_failed(retptr, this.__wbg_ptr, now, online, visible, rand, conn);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} req\n * @param {boolean} ok\n * @param {string} token\n * @returns {string}\n */\n on_token(now, online, visible, rand, req, ok, token) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livewatch_on_token(retptr, this.__wbg_ptr, now, online, visible, rand, req, ok, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} req\n * @param {boolean} ok\n * @param {string} access\n * @returns {string}\n */\n on_probe(now, online, visible, rand, req, ok, access) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(access, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livewatch_on_probe(retptr, this.__wbg_ptr, now, online, visible, rand, req, ok, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} req\n * @param {boolean} ok\n * @param {string} events_json\n * @param {number} from\n * @param {number} to\n * @returns {string}\n */\n on_range(now, online, visible, rand, req, ok, events_json, from, to) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(events_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livewatch_on_range(retptr, this.__wbg_ptr, now, online, visible, rand, req, ok, ptr0, len0, from, to);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {number} req\n * @param {boolean} ok\n * @param {string} snapshot_json\n * @returns {string}\n */\n on_snapshot(now, online, visible, rand, req, ok, snapshot_json) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(snapshot_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livewatch_on_snapshot(retptr, this.__wbg_ptr, now, online, visible, rand, req, ok, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * `content_json` = ContentPart[] (a borda converte texto/anexos).\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {string} message_id\n * @param {string} content_json\n * @param {string} mode\n * @returns {string}\n */\n send(now, online, visible, rand, message_id, content_json, mode) {\n let deferred5_0;\n let deferred5_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(message_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(content_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.livewatch_send(retptr, this.__wbg_ptr, now, online, visible, rand, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr4 = r0;\n var len4 = r1;\n if (r3) {\n ptr4 = 0; len4 = 0;\n throw takeObject(r2);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);\n }\n }\n /**\n * Troca de agente (\u00A717.4) no mesmo canal ordenado dos comandos; `to_json` = `{agentId?, model?, effort?}` (o\n * realtime completa e valida; provider/agentName que vierem s\u00E3o ignorados). O `resolve`\n * sai com o ref `switch:<switch_id>`.\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {string} switch_id\n * @param {string} to_json\n * @returns {string}\n */\n switch_agent(now, online, visible, rand, switch_id, to_json) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(switch_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(to_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.livewatch_switch_agent(retptr, this.__wbg_ptr, now, online, visible, rand, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr3 = r0;\n var len3 = r1;\n if (r3) {\n ptr3 = 0; len3 = 0;\n throw takeObject(r2);\n }\n deferred4_0 = ptr3;\n deferred4_1 = len3;\n return getStringFromWasm0(ptr3, len3);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n }\n /**\n * S\u00F3 modelo/esfor\u00E7o do mesmo agente (`change_json` = `{model?, effort?}`). Ref `switch:<switch_id>`.\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {string} switch_id\n * @param {string} change_json\n * @returns {string}\n */\n switch_model(now, online, visible, rand, switch_id, change_json) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(switch_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(change_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.livewatch_switch_model(retptr, this.__wbg_ptr, now, online, visible, rand, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr3 = r0;\n var len3 = r1;\n if (r3) {\n ptr3 = 0; len3 = 0;\n throw takeObject(r2);\n }\n deferred4_0 = ptr3;\n deferred4_1 = len3;\n return getStringFromWasm0(ptr3, len3);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n }\n /**\n * Cancela a troca agendada (frame `cancelSwitch`). Ref `switch:<switch_id>`.\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {string} switch_id\n * @returns {string}\n */\n cancel_switch(now, online, visible, rand, switch_id) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(switch_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livewatch_cancel_switch(retptr, this.__wbg_ptr, now, online, visible, rand, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * O ref que o pr\u00F3ximo `queue_op` vai usar (a borda espera o `resolve` dele).\n * @returns {string}\n */\n next_queue_ref() {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livewatch_next_queue_ref(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {string} op_json\n * @returns {string}\n */\n queue_op(now, online, visible, rand, op_json) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(op_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livewatch_queue_op(retptr, this.__wbg_ptr, now, online, visible, rand, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0; len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n }\n /**\n * Comando cru com `ref` (stop/respond/resend/reset).\n * @param {number} now\n * @param {boolean} online\n * @param {boolean} visible\n * @param {number} rand\n * @param {string} frame_json\n * @returns {string}\n */\n command(now, online, visible, rand, frame_json) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(frame_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livewatch_command(retptr, this.__wbg_ptr, now, online, visible, rand, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0; len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n }\n /**\n * @returns {string}\n */\n load_older() {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livewatch_load_older(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @returns {string}\n */\n load_newer() {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livewatch_load_newer(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * `anchor_json` = {\"messageId\": \"msg_\u2026\"} | {\"eventId\": N}\n * @param {string} anchor_json\n * @returns {string}\n */\n jump_to(anchor_json) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(anchor_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livewatch_jump_to(retptr, this.__wbg_ptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0; len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n }\n /**\n * @returns {string}\n */\n jump_to_end() {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livewatch_jump_to_end(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * `page_json` = a p\u00E1gina no formato do log ({items: envelopes, hasBefore, hasAfter, anchorIndex?\u2026});\n * com `ok=false`, `page_json` \u00E9 a mensagem de erro.\n * @param {number} req\n * @param {boolean} ok\n * @param {string} page_json\n * @returns {string}\n */\n on_history(req, ok, page_json) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(page_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.livewatch_on_history(retptr, this.__wbg_ptr, req, ok, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * @returns {string}\n */\n status() {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livewatch_status(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @returns {number}\n */\n cursor() {\n const ret = wasm.livewatch_cursor(this.__wbg_ptr);\n return ret;\n }\n /**\n * @returns {string}\n */\n via() {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.livewatch_via(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * @returns {number}\n */\n next_deadline() {\n const ret = wasm.livewatch_next_deadline(this.__wbg_ptr);\n return ret;\n }\n}\n\nconst ReducerFinalization = (typeof FinalizationRegistry === 'undefined')\n ? { register: () => {}, unregister: () => {} }\n : new FinalizationRegistry(ptr => wasm.__wbg_reducer_free(ptr >>> 0, 1));\n/**\n * O reducer do contrato, em Rust (o mesmo que os nativos usam).\n */\nexport class Reducer {\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n ReducerFinalization.unregister(this);\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_reducer_free(ptr, 0);\n }\n constructor() {\n const ret = wasm.reducer_new();\n this.__wbg_ptr = ret >>> 0;\n ReducerFinalization.register(this, this.__wbg_ptr, this);\n return this;\n }\n /**\n * @param {string} event_json\n */\n apply(event_json) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(event_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.reducer_apply(retptr, this.__wbg_ptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n if (r1) {\n throw takeObject(r0);\n }\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * @returns {string}\n */\n state_json() {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.reducer_state_json(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * Parte de um estado (o snapshot) em vez do vazio.\n * @param {string} state_json\n */\n load_state(state_json) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(state_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.reducer_load_state(retptr, this.__wbg_ptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n if (r1) {\n throw takeObject(r0);\n }\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbindgen_error_new = function(arg0, arg1) {\n const ret = new Error(getStringFromWasm0(arg0, arg1));\n return addHeapObject(ret);\n };\n imports.wbg.__wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n\n return imports;\n}\n\nfunction __wbg_init_memory(imports, memory) {\n\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n __wbg_init_memory(imports);\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n __wbg_init_memory(imports);\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n", "// O n\u00FAcleo \u00FAnico (Rust, sdk/core-rs) compilado pra wasm. Tudo o que decide (sequ\u00EAncia, transporte, reducer)\n// mora l\u00E1; este pacote \u00E9 a borda: sockets, rel\u00F3gio, getToken (DESIGN \u00A714, princ\u00EDpio 1).\n// Os BYTES (o grosso do peso) ficam num m\u00F3dulo \u00E0 parte, importado sob demanda: o bundler os p\u00F5e num peda\u00E7o\n// separado, que s\u00F3 baixa quando a camada ao vivo nasce \u2014 e baixa em paralelo, sem segurar a tela nem o REST.\n// A cola JS (`live.js`) \u00E9 pequena e fica junto. Sem fetch nem plugin de bundler: os bytes s\u00E3o base64.\nimport * as live from './wasm/live.js'\n\nlet ready = false\nlet loading: Promise<typeof live> | null = null\n\nfunction decode(b64: string): Uint8Array {\n if (typeof atob === 'function') {\n const bin = atob(b64)\n const out = new Uint8Array(bin.length)\n for (let i = 0; i < bin.length; i++) out[i] = bin.charCodeAt(i)\n return out\n }\n return Uint8Array.from(Buffer.from(b64, 'base64'))\n}\n\n/** Carrega o n\u00FAcleo (uma vez). A camada ao vivo chama sozinha; chamar antes s\u00F3 adianta o download. */\nexport function loadCore(): Promise<typeof live> {\n if (ready) return Promise.resolve(live)\n loading ??= import('./wasm/bytes').then(({ WASM_BASE64 }) => {\n if (!ready) {\n live.initSync({ module: decode(WASM_BASE64) })\n ready = true\n }\n return live\n })\n return loading\n}\n\n/** O n\u00FAcleo, se j\u00E1 carregou (sen\u00E3o `null`: quem usa enfileira at\u00E9 `loadCore()` resolver). */\nexport function coreIfReady(): typeof live | null {\n return ready ? live : null\n}\n\n/** O n\u00FAcleo j\u00E1 carregado; antes disso \u00E9 erro (use `loadCore()`). */\nexport function core(): typeof live {\n if (!ready) throw new Error('SmoothAgent: o n\u00FAcleo ainda est\u00E1 carregando \u2014 aguarde `loadCore()`')\n return live\n}\n", "// A BORDA comum do n\u00FAcleo Rust (DESIGN \u00A714): executa os efeitos de IO que o n\u00FAcleo pede \u2014 sockets, um timer\n// no pr\u00F3ximo prazo, getToken/probe/range/snapshot \u2014 e devolve o resultado como entrada. O que n\u00E3o \u00E9\n// IO (estado, debug, resolve\u2026) vai pro `handle` de quem usa (ChatStream, LiveChat). Nenhuma decis\u00E3o aqui.\nimport { SmoothAgentAuthError } from './auth'\nimport type { LiveDeps, SocketLike } from './deps'\nimport { coreIfReady, loadCore } from './native'\n\nexport type Env = [now: number, online: boolean, visible: boolean, rand: number]\n\n/** As entradas que todo n\u00FAcleo (LiveSession, LiveWatch) aceita; cada uma devolve os efeitos em JSON. */\nexport interface CoreLike {\n tick(...e: Env): string\n on_open(...a: [...Env, number]): string\n on_message(...a: [...Env, number, string]): string\n on_error(...a: [...Env, number]): string\n on_close(...a: [...Env, number, number, string]): string\n on_open_failed(...a: [...Env, number]): string\n on_token(...a: [...Env, number, boolean, string]): string\n on_probe(...a: [...Env, number, boolean, string]): string\n on_range(...a: [...Env, number, boolean, string, number, number]): string\n on_snapshot(...a: [...Env, number, boolean, string]): string\n next_deadline(): number\n}\n\nexport type IoFx =\n | { k: 'token' | 'probe' | 'snapshot'; req: number }\n | { k: 'invalidateToken' }\n | { k: 'range'; req: number; from: number; to: number }\n | { k: 'open'; conn: number; via: string; url: string; protocols: string[] }\n | { k: 'send'; conn: number; text: string }\n | { k: 'close'; conn: number; code: number; reason: string }\n\n/** Um efeito que n\u00E3o \u00E9 IO (cada casca trata os seus). */\nexport type OtherFx = { k: string; [x: string]: unknown }\n\nexport class Edge<C extends CoreLike> {\n private readonly sockets = new Map<number, SocketLike>()\n private timer: unknown = null\n private stopped = false\n /** O n\u00FAcleo desta casca; `null` at\u00E9 o wasm carregar (as entradas esperam em `pending`, em ordem). */\n core: C | null = null\n private pending: Array<(c: C) => void> = []\n\n constructor(\n make: () => C,\n private readonly d: LiveDeps,\n private readonly chatId: string,\n private readonly random: () => number,\n private readonly handle: (f: OtherFx) => void,\n ) {\n if (coreIfReady()) this.core = make()\n else\n void loadCore().then(() => {\n if (this.stopped && !this.pending.length) return\n const c = (this.core = make())\n const queued = this.pending\n this.pending = []\n for (const p of queued) p(c)\n })\n }\n\n /** Roda `fn` com o n\u00FAcleo: na hora se j\u00E1 carregou, sen\u00E3o na ordem em que foi pedido, quando carregar. */\n when(fn: (c: C) => void): void {\n if (this.core) fn(this.core)\n else this.pending.push(fn)\n }\n\n env(): Env {\n return [this.d.clock.now(), this.d.env.online(), this.d.env.visible(), this.random()]\n }\n\n /** Uma entrada pro n\u00FAcleo; executa os efeitos devolvidos, em ordem; re-arma o timer. */\n run(input: (c: C, e: Env) => string): void {\n if (this.stopped) return\n this.when((c) => this.exec(JSON.parse(input(c, this.env())) as Array<IoFx | OtherFx>))\n }\n\n /** Executa uma lista de efeitos j\u00E1 devolvida (quando quem chamou precisou do JSON antes). */\n exec(fx: Array<IoFx | OtherFx>): void {\n for (const f of fx) this.one(f)\n this.arm()\n }\n\n /** Para tudo (depois do close do n\u00FAcleo): sem timer, sem novas entradas. */\n stop(): void {\n this.stopped = true\n this.disarm()\n // fechou antes do n\u00FAcleo carregar: nada abriu ainda (as entradas esperavam); some sem nascer\n if (!this.core) this.pending = []\n }\n\n private arm(): void {\n this.disarm()\n if (this.stopped || !this.core) return\n const at = this.core.next_deadline()\n if (at < 0) return\n this.timer = this.d.clock.setTimeout(() => {\n this.timer = null\n this.run((c, e) => c.tick(...e))\n }, Math.max(0, at - this.d.clock.now()))\n }\n\n private disarm(): void {\n if (this.timer !== null) {\n this.d.clock.clearTimeout(this.timer)\n this.timer = null\n }\n }\n\n private one(f: IoFx | OtherFx): void {\n const d = this.d\n const chatId = this.chatId\n switch (f.k) {\n case 'token': {\n const req = (f as { req: number }).req\n d.token().then(\n (t) => this.run((c, e) => c.on_token(...e, req, true, t)),\n // o motivo decide: `revoked`/`missing`/`invalid` param de vez; o resto (rede, 500) entra no backoff\n (err: unknown) => this.run((c, e) => c.on_token(...e, req, false, err instanceof SmoothAgentAuthError ? err.reason : 'error')),\n )\n return\n }\n case 'invalidateToken':\n d.invalidateToken?.()\n return\n case 'probe': {\n const req = (f as { req: number }).req\n d.probeAccess!(chatId).then(\n (a) => this.run((c, e) => c.on_probe(...e, req, true, a)),\n () => this.run((c, e) => c.on_probe(...e, req, false, '')),\n )\n return\n }\n case 'range': {\n const { req, from, to } = f as { req: number; from: number; to: number }\n d.eventsRange!(chatId, from, to).then(\n (r) => this.run((c, e) => c.on_range(...e, req, true, JSON.stringify(r.events), r.range.from, r.range.to)),\n () => this.run((c, e) => c.on_range(...e, req, false, '[]', 0, 0)),\n )\n return\n }\n case 'snapshot': {\n const req = (f as { req: number }).req\n d.snapshot!(chatId).then(\n (s) => this.run((c, e) => c.on_snapshot(...e, req, true, JSON.stringify(s))),\n () => this.run((c, e) => c.on_snapshot(...e, req, false, '')),\n )\n return\n }\n case 'open': {\n const { conn, url, protocols } = f as { conn: number; url: string; protocols: string[] }\n return this.open(conn, url, protocols)\n }\n case 'send': {\n const { conn, text } = f as { conn: number; text: string }\n const sock = this.sockets.get(conn)\n if (sock && sock.readyState === 1) sock.send(text)\n return\n }\n case 'close': {\n const { conn, code, reason } = f as { conn: number; code: number; reason: string }\n const sock = this.sockets.get(conn)\n this.sockets.delete(conn)\n if (!sock) return\n sock.onopen = sock.onmessage = sock.onclose = sock.onerror = null\n try {\n sock.close(code, reason)\n } catch {\n /* j\u00E1 fechado */\n }\n return\n }\n default:\n this.handle(f as OtherFx)\n }\n }\n\n private open(conn: number, url: string, protocols: string[]): void {\n let sock: SocketLike\n try {\n sock = this.d.openSocket(url, protocols)\n } catch {\n this.run((c, e) => c.on_open_failed(...e, conn))\n return\n }\n this.sockets.set(conn, sock)\n sock.onopen = () => this.run((c, e) => c.on_open(...e, conn))\n sock.onmessage = (ev) => this.run((c, e) => c.on_message(...e, conn, String(ev.data)))\n sock.onerror = () => this.run((c, e) => c.on_error(...e, conn))\n sock.onclose = (ev) => {\n this.sockets.delete(conn)\n this.run((c, e) => c.on_close(...e, conn, ev.code, ev.reason ?? ''))\n }\n }\n}\n", "// Ids gerados no cliente (sem depend\u00EAncia: o REST usa sem puxar a camada ao vivo).\n\n/**\n * `messageId` gerado no cliente: `msg_` + UUIDv7 (contrato control: `^msg_[A-Za-z0-9_-]{8,64}$`).\n * \u00C9 a idempot\u00EAncia e o dedupe do log; o prefixo separa mensagem de n\u00FAmero de evento no `history?around=`.\n */\nexport function newMessageId(nowMs: number = Date.now()): string {\n return 'msg_' + uuidv7(nowMs)\n}\n\n/** UUIDv7 (orden\u00E1vel no tempo). */\nexport function uuidv7(nowMs: number = Date.now()): string {\n const bytes = new Uint8Array(16)\n globalThis.crypto.getRandomValues(bytes)\n let ts = BigInt(Math.floor(nowMs))\n for (let i = 5; i >= 0; i--) {\n bytes[i] = Number(ts & 0xffn)\n ts >>= 8n\n }\n bytes[6] = (bytes[6]! & 0x0f) | 0x70\n bytes[8] = (bytes[8]! & 0x3f) | 0x80\n const hex = [...bytes].map((b) => b.toString(16).padStart(2, '0')).join('')\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`\n}\n", "// GERADO por sdk/core-rs/build-wasm.mjs de sdk/core-rs/fixtures/empty-state.json \u2014 n\u00E3o editar.\nexport const EMPTY_STATE_JSON = \"{\\\"seq\\\":0,\\\"chat\\\":{\\\"state\\\":\\\"idle\\\"},\\\"items\\\":{},\\\"order\\\":[],\\\"history\\\":[],\\\"tasks\\\":{},\\\"pending\\\":{},\\\"limits\\\":{},\\\"usage\\\":{\\\"chat\\\":{}},\\\"runs\\\":[],\\\"switches\\\":[]}\"\n", "/* GERADO por gen-ts.mjs \u2014 n\u00E3o editar. Tudo fora destas listas: IGNORAR (tipo desconhecido n\u00E3o \u00E9 erro). Sem node:fs: vai pro bundle de navegador. */\nimport type { Capabilities, ErrorCode, FailureReason } from './events';\nexport const KNOWN_EVENT_TYPES = [\"session.started\",\"chat.state\",\"run.started\",\"run.waiting\",\"run.completed\",\"usage.updated\",\"item.started\",\"item.delta\",\"item.updated\",\"item.completed\",\"item.retracted\",\"task.updated\",\"context.updated\",\"limits.updated\",\"agent.switched\",\"agent.switch_failed\",\"notice\",\"error\"] as const;\nexport const KNOWN_ITEM_KINDS = [\"user_message\",\"text\",\"reasoning\",\"tool_call\",\"command\",\"file_change\",\"file_search\",\"web_search\",\"plan\",\"proposed_plan\",\"subagent\",\"notification\",\"timer\",\"approval\",\"question\",\"compaction\",\"handoff\",\"hook\",\"error\"] as const;\nexport const KNOWN_ERROR_CODES = [\"unauthorized\",\"forbidden\",\"not_found\",\"invalid_request\",\"provider_not_connected\",\"provider_auth_expired\",\"provider_error\",\"usage_limit_reached\",\"plan_limit\",\"rate_limited\",\"box_unavailable\",\"conflict\",\"machine_offline\",\"request_expired\",\"no_run\",\"queue_full\",\"internal\"] as const satisfies readonly ErrorCode[];\nexport const KNOWN_FAILURE_REASONS = [\"no_credit\",\"subscription_limit\",\"rate_limited\",\"out_of_memory\",\"context_window_exceeded\",\"auth_failed\",\"provider_crashed\",\"max_turns\",\"network\",\"request_expired\",\"grant_revoked\",\"unknown\"] as const satisfies readonly FailureReason[];\n/** status HTTP de cada c\u00F3digo de erro (\u00A76) */\nexport const ERROR_CODE_HTTP = {\"unauthorized\":401,\"forbidden\":403,\"not_found\":404,\"invalid_request\":400,\"provider_not_connected\":424,\"provider_auth_expired\":424,\"provider_error\":502,\"usage_limit_reached\":429,\"plan_limit\":402,\"rate_limited\":429,\"box_unavailable\":503,\"conflict\":409,\"machine_offline\":409,\"request_expired\":410,\"no_run\":409,\"queue_full\":429,\"internal\":500} as const satisfies Record<ErrorCode, number>;\nexport const CONTRACT_VERSION = '0.1.0';\n/** M42: a tabela \u00DANICA de capabilities por provedor (capabilities.json). fake = a linha do sabor dele. */\nexport const PROVIDER_CAPABILITIES = {\"revision\":4,\"providers\":{\"claude\":{\"measuredOn\":\"2.1.310\",\"contextWindow\":{\"default\":200000,\"rules\":[{\"suffix\":\"[1m]\",\"tokens\":1000000}]},\"capabilities\":{\"version\":1,\"reasoning\":true,\"plans\":true,\"approvals\":false,\"questions\":true,\"subagents\":true,\"background\":true,\"wakeTurns\":true,\"taskStop\":true,\"timers\":false,\"fileChanges\":true,\"images\":true,\"contextUsage\":true,\"usageLimits\":true,\"costReporting\":true,\"parallelTools\":true,\"steering\":\"native\",\"steerBoundary\":\"tool\",\"steerRecall\":true,\"steerInterrupts\":\"nothing\",\"interrupt\":\"native\",\"consumptionSignal\":\"echo\",\"modelSwitchInSession\":true,\"resume\":true,\"effortSwitch\":\"live\",\"handoffInject\":\"native_history\",\"mcpSwitch\":\"live\"}},\"codex\":{\"measuredOn\":\"0.163.0\",\"contextWindow\":{\"default\":258400,\"rules\":[]},\"capabilities\":{\"version\":1,\"reasoning\":true,\"reasoningSummary\":true,\"plans\":true,\"proposedPlans\":true,\"approvals\":true,\"questions\":true,\"subagents\":true,\"background\":true,\"wakeTurns\":false,\"taskStop\":true,\"timers\":false,\"fileChanges\":true,\"images\":true,\"boxFiles\":false,\"contextUsage\":true,\"usageLimits\":true,\"costReporting\":false,\"parallelTools\":true,\"steering\":\"native\",\"steerBoundary\":\"model_call\",\"steerRecall\":false,\"steerDuringCompaction\":\"waits_turn\",\"steerInterrupts\":\"response\",\"interrupt\":\"native\",\"consumptionSignal\":\"echo\",\"streaming\":{\"text\":true,\"reasoning\":true,\"toolInput\":false,\"commandOutput\":true,\"planText\":true},\"modelSwitchInSession\":true,\"effortSwitch\":\"live\",\"resume\":true,\"handoffInject\":\"native_history\",\"mcpSwitch\":\"live\"}}}} as const satisfies { revision: number; providers: Record<string, { measuredOn: string; contextWindow: { default: number; rules: ReadonlyArray<{ id?: string; prefix?: string; suffix?: string; tokens: number }> }; capabilities: Capabilities }> };\n", "// A pol\u00EDtica do backoff do transporte (T3: um dono s\u00F3 do retry, jitter, teto, zera s\u00F3 depois que a conex\u00E3o\n// FICA de p\u00E9; proposta sdk \u00A74.7). O backoff em si mora no n\u00FAcleo Rust (sdk/core-rs, util.rs).\nexport interface BackoffPolicy {\n baseMs: number\n factor: number\n capVisibleMs: number\n capHiddenMs: number\n /** S\u00F3 zera o contador depois de ficar de p\u00E9 este tempo. */\n stableMs: number\n}\n\nexport const DEFAULT_BACKOFF: BackoffPolicy = {\n baseMs: 250,\n factor: 2,\n capVisibleMs: 30_000,\n capHiddenMs: 300_000,\n stableMs: 10_000,\n}\n", "// UMA assinatura l\u00F3gica de um chat, com o transporte trocando sozinho por baixo (DESIGN \u00A75.1.8, \u00A79.1).\n//\n// CASCA FINA: quem decide \u00E9 o n\u00FAcleo \u00FAnico em Rust (sdk/core-rs, `Session`, compilado pra wasm \u2014 DESIGN \u00A714,\n// princ\u00EDpio 1). Esta classe s\u00F3 \u00E9 a borda: abre/fecha os sockets que o n\u00FAcleo pede, entrega os frames, chama\n// getToken/probe/range/snapshot, mant\u00E9m UM timer no pr\u00F3ximo prazo do n\u00FAcleo e repassa o resto pros\n// listeners. A API p\u00FAblica \u00E9 a mesma de antes (o Studio e o `watch()` dependem dela).\nimport type { ErrorCode as ContractErrorCode } from '../../../../contract/events/ts/src/gen/events'\nimport { ERROR_CODE_HTTP, KNOWN_ERROR_CODES } from '../../../../contract/events/ts/src/gen/known'\nimport { DEFAULT_BACKOFF, type BackoffPolicy } from './backoff'\nimport type { LiveDeps } from './deps'\nimport { uuidv7 } from './ids'\nimport { Edge, type OtherFx } from './edge'\nimport { core } from './native'\nimport type { BoxPresence, ChatSnapshot, ClientFrame, Envelope, InboxState, QueueState, ServerFrame, SubmitResult } from './types'\nimport type { LiveSession } from './wasm/live.js'\n\n/** auth_failed = token inv\u00E1lido/revogado (4401) \u00B7 forbidden = sem grant no chat/agente (4403). Nenhum dos dois religa sozinho. */\nexport type LiveStatus = 'connecting' | 'synchronizing' | 'live' | 'reconnecting' | 'offline' | 'auth_failed' | 'forbidden' | 'closed'\n\nexport { PING, PONG } from './deps'\n/** Por onde a tela fala: sempre o conector do realtime (DESIGN \u00A717.4 \u2014 ele repassa pra box quente). */\nexport type Via = 'connector'\n\nexport type DebugEvent =\n /** `timeout` com `reason:'sync'` = a conex\u00E3o n\u00E3o sincronizou no prazo (B-39): derrubada e assinada de novo */\n | { kind: 'transport'; via: Via; what: 'connecting' | 'open' | 'close' | 'dead' | 'fail' | 'error' | 'timeout'; code?: number; reason?: string }\n | { kind: 'switch'; from: Via | null; to: Via }\n | { kind: 'dup_dropped' | 'gap_detected' | 'gap_closed' | 'compacted_skip'; from: number; to: number }\n | { kind: 'resync'; reason: string }\n | { kind: 'cursor'; seq: number }\n | { kind: 'resend'; ref: string; attempt?: number }\n /** O servidor falhou de passagem (`retryable`): o mesmo comando sai de novo em `inMs`. */\n | { kind: 'retry'; ref: string; code: string | null; attempt: number; inMs: number }\n\n/**\n * Modo estrito (pro `tests`): em vez de esconder o problema (resync), reporta.\n * - gap_timeout: buraco que n\u00E3o fechou no prazo (o estado fica parado no buraco);\n * - out_of_order: a camada ia aplicar um seq que n\u00E3o \u00E9 o seguinte (n\u00E3o deveria acontecer nunca);\n * - snapshot_regressed: snapshot com seq menor que o j\u00E1 aplicado;\n * - bad_time_unit: epoch de frame que veio em segundos/\u00B5s (o contrato \u00E9 ms) \u2014 converte, mas reporta;\n * - bad_ack: `ack` com status fora do SubmitResult (o app recebe `rejected`).\n * Duplicado pelos dois transportes \u00E9 normal (s\u00F3 `dup_dropped` no debug).\n */\nexport interface Violation {\n kind: 'gap_timeout' | 'out_of_order' | 'snapshot_regressed' | 'bad_time_unit' | 'bad_ack'\n from: number\n to: number\n cursor: number\n at: number\n}\n\nexport interface StreamListener {\n snapshot?(s: ChatSnapshot): void\n events?(evs: Envelope[]): void\n /** @deprecated \u00A717: use `queue`. */\n inbox?(inbox: InboxState): void\n /** A fila (\u00A717, `QueueState`), j\u00E1 pela maior vers\u00E3o. */\n queue?(queue: QueueState): void\n box?(box: BoxPresence, via: Via): void\n status?(status: LiveStatus): void\n /** Frames que esta camada n\u00E3o trata (ex. `test.*`, extens\u00F5es futuras). */\n other?(frame: ServerFrame): void\n debug?(e: DebugEvent): void\n /** S\u00F3 no modo estrito: o que a camada teria escondido (resync) vira viola\u00E7\u00E3o vis\u00EDvel. */\n violation?(v: Violation): void\n}\n\nexport interface StreamOptions {\n chatId: string\n /** Retomar de um cache: estado j\u00E1 aplicado at\u00E9 aqui (pula o snapshot). */\n resumeFrom?: { cursor: number; inboxVersion: number }\n includeRaw?: boolean\n backoff?: BackoffPolicy\n random?: () => number\n pingEveryMs?: number\n pongTimeoutMs?: number\n /** Troca dentro deste prazo n\u00E3o muda o status (o usu\u00E1rio n\u00E3o percebe). */\n switchGraceMs?: number\n /** Conector que abre e n\u00E3o manda snapshot/replay neste prazo \u00E9 tratado como morto (T3: 15 s). */\n syncTimeoutMs?: number\n gapTimeoutMs?: number\n /** Voltar de background mais longo que isto troca o socket na hora em vez de sondar (T3). */\n longAwayMs?: number\n /** Comando sem `ack` neste prazo (socket de p\u00E9, frame sumido) = reenvia o MESMO frame (padr\u00E3o 10 s). */\n ackTimeoutMs?: number\n /** B-45: com a aba vis\u00EDvel, confere a fila (o snapshot do REST, s\u00F3 a fila) a cada tanto (padr\u00E3o 5 min; 0 = nunca). */\n queueCheckEveryMs?: number\n /** Foco/aba vis\u00EDvel de novo tamb\u00E9m conferem a fila, no m\u00E1ximo uma vez neste intervalo (padr\u00E3o 30 s). */\n queueCheckMinMs?: number\n /** Modo estrito (testes): buraco vira viola\u00E7\u00E3o em vez de resync. Ver `Violation`. */\n strict?: boolean\n}\n\n/** Epoch dos frames em ms (a regra mora no n\u00FAcleo; ver `Violation.bad_time_unit`). */\nexport function toMs(epoch: number, now: number = Date.now()): number {\n return core().to_ms(epoch, now)\n}\n\n/** C\u00F3digos fechados de erro (DESIGN \u00A76) \u2014 a lista \u00E9 a do contrato (@smoothagent/events/known). */\nexport const ERROR_CODES = KNOWN_ERROR_CODES\nexport type ErrorCode = ContractErrorCode\nexport { ERROR_CODE_HTTP }\nexport const errorCode = (c: unknown): ErrorCode => (typeof c === 'string' ? (core().error_code(c) as ErrorCode) : 'internal')\n\n/**\n * `ref` de comando \u00DANICO entre interfaces (o realtime guarda o recibo por `ref` no chat: repetido, a 2\u00AA tela\n * receberia o recibo da 1\u00AA e o comando dela sumiria calado \u2014 ORD-05). UUIDv7 = tempo + 74 bits aleat\u00F3rios.\n */\nexport const newRef = (): string => `r_${uuidv7()}`\n\nexport class ChatStream {\n private readonly edge: Edge<LiveSession>\n private readonly waiting = new Map<string, { resolve(r: SubmitResult): void; reject(e: Error): void }>()\n private closed = false\n private readonly unWake: () => void\n\n constructor(\n private readonly d: LiveDeps,\n private readonly opts: StreamOptions,\n private readonly l: StreamListener,\n ) {\n const cfg = JSON.stringify(sessionConfig(d, opts))\n this.edge = new Edge(() => new (core().LiveSession)(cfg), d, opts.chatId, opts.random ?? Math.random, (f) => this.handle(f))\n this.unWake = d.env.onWake((why, awayMs) => this.edge.run((c, e) => c.wake(...e, why, awayMs ?? 0)))\n this.edge.run((c, e) => c.start(...e))\n }\n\n // ------------------------------------------------------------------ API (a mesma de antes)\n\n get status(): LiveStatus {\n return (this.edge.core?.status() ?? (this.closed ? 'closed' : 'connecting')) as LiveStatus\n }\n get cursor(): number {\n return this.edge.core?.cursor() ?? this.opts.resumeFrom?.cursor ?? 0\n }\n get via(): Via | null {\n return (this.edge.core?.via() || null) as Via | null\n }\n get box(): BoxPresence | null {\n const b = this.edge.core?.box_presence()\n return b ? (JSON.parse(b) as BoxPresence) : null\n }\n\n /**\n * Manda um comando (send/queue/stop/respond/resend/reset). Resolve com o `ack` \u2014 que s\u00F3 vem depois de\n * gravado no log. Cai o socket antes do ack: o n\u00FAcleo reenvia o MESMO frame no pr\u00F3ximo transporte; o\n * servidor devolve `duplicate`. Nunca rejeita por transporte; s\u00F3 por close()/revoga\u00E7\u00E3o.\n */\n command(frame: ClientFrame & { ref: string }): Promise<SubmitResult> {\n if (this.closed) return Promise.reject(new Error('stream closed'))\n return new Promise((resolve, reject) => {\n this.waiting.set(frame.ref, { resolve, reject })\n this.edge.run((c, e) => c.command(...e, JSON.stringify(frame)))\n })\n }\n\n /** Token do usu\u00E1rio renovado: vai pelo socket do conector sem derrubar. */\n tokenRenewed(token: string): void {\n this.edge.run((c, e) => c.token_renewed(...e, token))\n }\n\n retry(): void {\n this.edge.run((c, e) => c.wake(...e, 'manual', 0))\n }\n\n close(): void {\n if (this.closed) return\n this.edge.run((c, e) => c.close(...e))\n this.closed = true\n this.unWake()\n this.edge.stop()\n }\n\n private handle(f: OtherFx): void {\n const v = f.v as never\n switch (f.k) {\n case 'onSnapshot':\n return this.l.snapshot?.(v)\n case 'onEvents':\n return this.l.events?.(v)\n case 'onInbox':\n return this.l.inbox?.(v)\n case 'onQueue':\n return this.l.queue?.(v)\n case 'onBox':\n return this.l.box?.(v, f.via as Via)\n case 'onStatus':\n return this.l.status?.(v)\n case 'onDebug':\n return this.l.debug?.(v)\n case 'onViolation':\n return this.l.violation?.(v)\n case 'onOther':\n return this.l.other?.(v)\n case 'resolve': {\n const w = this.waiting.get(f.ref as string)\n this.waiting.delete(f.ref as string)\n return w?.resolve(v)\n }\n case 'reject': {\n const w = this.waiting.get(f.ref as string)\n this.waiting.delete(f.ref as string)\n return w?.reject(new Error(String(f.v)))\n }\n }\n }\n}\n\n/** A configura\u00E7\u00E3o do n\u00FAcleo a partir das op\u00E7\u00F5es do TS (a mesma pro ChatStream e pro LiveChat). */\nexport function sessionConfig(d: LiveDeps, opts: StreamOptions): Record<string, unknown> {\n const b = opts.backoff ?? DEFAULT_BACKOFF\n return {\n chatId: opts.chatId,\n connectorUrl: d.connectorUrl(opts.chatId),\n ...(opts.resumeFrom ? { resumeCursor: opts.resumeFrom.cursor, resumeInboxVersion: opts.resumeFrom.inboxVersion } : {}),\n includeRaw: opts.includeRaw ?? false,\n strict: opts.strict ?? false,\n pingEveryMs: opts.pingEveryMs,\n pongTimeoutMs: opts.pongTimeoutMs,\n switchGraceMs: opts.switchGraceMs,\n syncTimeoutMs: opts.syncTimeoutMs,\n gapTimeoutMs: opts.gapTimeoutMs,\n longAwayMs: opts.longAwayMs,\n ackTimeoutMs: opts.ackTimeoutMs,\n queueCheckEveryMs: opts.queueCheckEveryMs,\n queueCheckMinMs: opts.queueCheckMinMs,\n backoff: { baseMs: b.baseMs, factor: b.factor, capVisibleMs: b.capVisibleMs, capHiddenMs: b.capHiddenMs, stableMs: b.stableMs },\n has: { probeAccess: !!d.probeAccess, eventsRange: !!d.eventsRange, snapshot: !!d.snapshot },\n }\n}\n", "import type {\n BoxPresence,\n CFSend,\n ChatState,\n ClientFrame,\n ContentPart as ContractContentPart,\n ErrorCode,\n Event,\n InboxState,\n Origin,\n Provider,\n RawFrame,\n SnapshotPayload,\n SubmitAccepted,\n SubmitConflict,\n SubmitDuplicate,\n Timestamp,\n} from '../../../../contract/events/ts/src/gen/events'\n\n// Os tipos do fio e dos canais v\u00EAm GERADOS do contrato (contract/events, auditoria H23): nada copiado \u00E0 m\u00E3o.\n// Aqui ficam s\u00F3 os nomes que a API da SDK j\u00E1 expunha e o `Envelope` solto (abaixo).\nexport type {\n AgentSelection,\n QueueItem,\n QueueState,\n PendingSwitch,\n BoxPresence,\n ChatState,\n ClientFrame,\n ErrorCode,\n Event,\n InboxEntry,\n InboxState,\n Origin,\n QueueOp,\n RawFrame,\n ScheduledSwitch,\n ServerFrame,\n FeedFrame,\n} from '../../../../contract/events/ts/src/gen/events'\n\n/**\n * Um evento da timeline com `type`/`data` soltos (o app l\u00EA campos sem estreitar a uni\u00E3o). \u00C9 o envelope do\n * contrato (`Event`) sem a amarra\u00E7\u00E3o por tipo; pra estreitar por `type`, use `Event`.\n */\nexport interface Envelope {\n /** = String(seq) */\n id: string\n seq: number\n /** fencing: a concess\u00E3o que numerou */\n epoch?: number\n chatId: string\n ts: string\n type: string\n runId?: string\n itemId?: string\n parentItemId?: string\n origin?: Origin\n /** s\u00F3 com `includeRaw` */\n raw?: RawFrame[]\n data?: Record<string, unknown>\n}\n\nexport type SendMode = CFSend['mode']\n\n/**\n * \"Conecte sua conta\": o usu\u00E1rio roda com a PR\u00D3PRIA credencial do provedor e ela falta ou venceu. Derivado no\n * n\u00FAcleo (o snapshot/F5 reproduz): fila parada por `auth`, \u00FAltimo run falhado por `provider_not_connected`/\n * `provider_auth_expired`, ou send/resend recusado com esses c\u00F3digos. Some no `run.started` seguinte.\n */\nexport interface NeedsProvider {\n provider: Provider\n reason: 'not_connected' | 'auth_expired'\n /** desde quando a fila est\u00E1 parada (o `held.since`) */\n since?: Timestamp\n}\n\n/** Peda\u00E7o do conte\u00FAdo de uma mensagem \u2014 o tipo GERADO do contrato. No fio do WS o conte\u00FAdo \u00E9 SEMPRE lista. */\nexport type ContentPart = ContractContentPart\n\n/**\n * Texto solto vira `[{type:'text', text}]` (o realtime recusa string no `send` e no `edit`); anexos\n * (`fileId` do upload) entram como partes `file` \u2014 o frame n\u00E3o tem campo `attachments`.\n */\nexport function toContentParts(content: string | ContentPart[], attachments: string[] = []): ContentPart[] {\n const parts: ContentPart[] = typeof content === 'string' ? [{ type: 'text', text: content }] : [...content]\n for (const fileId of attachments) parts.push({ type: 'file', fileId })\n return parts\n}\n\n/**\n * A resposta de um comando, s\u00F3 depois de gravado no log. O `rejected` da SDK traz sempre um c\u00F3digo do \u00A76\n * (`ErrorCode`): c\u00F3digo fora da lista vira `internal` (e `bad_ack` no modo estrito).\n */\nexport type SubmitResult = SubmitAccepted | SubmitDuplicate | SubmitConflict | { status: 'rejected'; code: ErrorCode; message: string }\n\n/** O snapshot que o servidor manda (o estado j\u00E1 reduzido no `seq`, a inbox, a presen\u00E7a e os recentes). */\nexport type ChatSnapshot = SnapshotPayload\n\n/** @deprecated o nome antigo; \u00E9 o `InboxState` do contrato. */\nexport type { InboxState as Inbox } from '../../../../contract/events/ts/src/gen/events'\n", "// `watch()` \u2014 o estado pronto da tela (DESIGN \u00A72.1, \u00A713; proposta sdk \u00A74.1\u2013\u00A74.9).\n//\n// CASCA FINA: o n\u00FAcleo \u00FAnico em Rust (sdk/core-rs, `Watch`) \u00E9 dono do transporte, do reducer do contrato, da\n// inbox, da presen\u00E7a, do otimista e da janela do hist\u00F3rico; ele devolve PATCHES do que mudou. Aqui s\u00F3 se\n// mant\u00E9m o espelho JS (itens que n\u00E3o mudaram mant\u00EAm a identidade \u2014 bom pro React), se executa o IO (Edge)\n// e se avisa quem assina. A API p\u00FAblica \u00E9 a mesma de antes.\nimport type { LiveDeps } from './deps'\nimport { Edge, type OtherFx } from './edge'\nimport { newMessageId, uuidv7 } from './ids'\nimport { core } from './native'\nimport { EMPTY_STATE_JSON } from './wasm/empty'\nimport { newRef, sessionConfig, type DebugEvent, type LiveStatus, type StreamOptions, type Via, type Violation } from './stream'\nimport { toContentParts, type QueueState, type BoxPresence, type ContentPart, type Envelope, type InboxState, type NeedsProvider, type QueueOp, type SendMode, type SubmitResult } from './types'\nimport type { LiveWatch } from './wasm/live.js'\n\nexport { newMessageId, uuidv7 }\n\n/** A troca, na forma do REST (`SwitchAgent`). */\nexport interface SwitchTo {\n agentId: string\n /**\n * Ausente = no MESMO agente fica o de agora; em OUTRO agente, o padr\u00E3o dele. `null` = (no mesmo agente) voltar ao\n * padr\u00E3o do agente. Tem que estar em `selection.options`.\n */\n model?: string | null\n effort?: string | null\n /** @deprecated ignorado: o servidor resolve o provedor pelo agente */\n provider?: string\n /** @deprecated ignorado: o servidor resolve o nome pelo agente */\n agentName?: string\n}\n\n/**\n * O reducer do contrato (contract/events). Com o n\u00FAcleo em Rust, o reducer que roda \u00E9 SEMPRE o do contrato\n * (o mesmo nos nativos); este tipo fica pra compatibilidade de quem j\u00E1 passava `contractReducer`.\n */\nexport interface Reducer<S, I = unknown> {\n empty(): S\n /** Pode mutar e devolver o mesmo objeto; a camada publica um estado novo por lote. */\n apply(state: S, ev: Envelope): S\n /** Itens FECHADOS, em ordem (o hist\u00F3rico ao vivo). */\n history(state: S): I[]\n /** Item de hist\u00F3rico a partir de uma entrada de p\u00E1gina do REST. */\n itemOf(entry: Envelope): I\n idOf(item: I): string\n}\n\nexport interface HistoryPage {\n items: Envelope[]\n firstEventId: number | null\n lastEventId: number | null\n hasBefore: boolean\n hasAfter: boolean\n anchorIndex?: number\n headEventId: number\n liveFromEventId?: number\n}\n\nexport type HistoryQuery = { limit?: number } & (\n | { before: number }\n | { after: number }\n | { around: { messageId: string } | { eventId: number } }\n | { anchor: 'end' }\n)\n\nexport interface WatchDeps extends LiveDeps {\n history?(chatId: string, q: HistoryQuery): Promise<HistoryPage>\n}\n\nexport interface LocalSend {\n messageId: string\n content: ContentPart[]\n mode: SendMode\n status: 'sending' | 'pending' | 'rejected'\n error?: string\n /** Vers\u00E3o da inbox que o ack disse conter a mensagem. */\n ackVersion?: number\n}\n\nexport interface HistoryWindow<I> {\n anchor: 'end' | 'detached'\n /** Os itens fechados que a tela mostra, em ordem. */\n items: I[]\n hasBefore: boolean\n hasAfter: boolean\n loadingBefore: boolean\n loadingAfter: boolean\n newWhileDetached: number\n /** Depois de `jumpTo`: o \u00EDndice do item \u00E2ncora em `items` (pra tela rolar at\u00E9 ele). */\n anchorIndex?: number\n error?: string\n}\n\nexport interface WatchState<S, I = unknown> {\n /** Sobe a cada mudan\u00E7a (comparar barato). */\n version: number\n timeline: S\n /**\n * A fila do chat (\u00A717): a MESMA venha da fila fria do realtime ou da box (a maior vers\u00E3o vale). Uma\n * mensagem some daqui quando o `user_message` com o mesmo messageId entra na timeline \u2014 nunca aparece 2\u00D7.\n */\n queue: QueueState\n /** @deprecated \u00A717 (lote 2 tira): use `queue`. */\n inbox: InboxState\n /** \"Conecte sua conta\" (ver `NeedsProvider`); null = nada a pedir. */\n needsProvider: NeedsProvider | null\n box: BoxPresence | null\n local: { sending: LocalSend[] }\n history: HistoryWindow<I>\n sync: { status: LiveStatus; cursor: number; via: Via | null; violations: Violation[] }\n}\n\nexport interface WatchOptions<S, I> extends Omit<StreamOptions, 'chatId'> {\n chatId: string\n /** Ignorado: o reducer \u00E9 o do contrato, no n\u00FAcleo (mantido pra compatibilidade). */\n reducer?: Reducer<S, I>\n /** Itens por p\u00E1gina do hist\u00F3rico (1\u2013200). */\n pageSize?: number\n /** Teto da janela: rolar muito solta a ponta oposta (a virtualiza\u00E7\u00E3o \u00E9 da tela). */\n maxWindow?: number\n onDebug?(e: DebugEvent): void\n /** Erro de auth definitivo (revogado). */\n onAuthFailed?(): void\n /** Modo estrito: cada viola\u00E7\u00E3o (tamb\u00E9m fica em `sync.violations`). */\n onViolation?(v: Violation): void\n}\n\nconst EMPTY_INBOX: InboxState = { version: -1, pending: [], queue: [], notDelivered: [], responses: [] }\nconst EMPTY_QUEUE: QueueState = { version: -1, owner: 'cold', turn: 'idle', items: [], notDelivered: [] }\n\ntype Listener<S, I> = (s: WatchState<S, I>) => void\n\ninterface Patch {\n version: number\n timeline?: { replace: Record<string, unknown> } | { set: Record<string, unknown>; del: string[]; items: Record<string, unknown> }\n inbox?: InboxState\n queue?: QueueState\n needsProvider?: NeedsProvider | null\n box?: BoxPresence | null\n local?: LocalSend[]\n history?: Omit<HistoryWindow<unknown>, 'items'> & { ids: string[]; items?: Record<string, unknown> }\n sync?: WatchState<unknown>['sync']\n}\n\ntype Input = Parameters<Edge<LiveWatch>['run']>[0]\n\nexport class LiveChat<S, I = unknown> {\n private readonly edge: Edge<LiveWatch>\n private state: WatchState<S, I>\n private readonly listeners = new Set<Listener<S, I>>()\n private readonly eventTaps = new Set<(evs: Envelope[]) => void>()\n private readonly waiting = new Map<string, { resolve(r: SubmitResult): void; reject(e: Error): void }>()\n private readonly historyWaiting = new Map<number, () => void>()\n /** itens que vieram de p\u00E1ginas do hist\u00F3rico (n\u00E3o est\u00E3o na timeline viva) */\n private readonly pageItems = new Map<string, I>()\n private historyIds: string[] = []\n private closed = false\n private readonly unWake: () => void\n\n constructor(\n private readonly d: WatchDeps,\n private readonly o: WatchOptions<S, I>,\n ) {\n this.state = {\n version: 0,\n // a timeline vazia do n\u00FAcleo (forma completa: order, items, runs\u2026) antes do wasm e do 1\u00BA snapshot\n timeline: JSON.parse(EMPTY_STATE_JSON) as S,\n queue: EMPTY_QUEUE,\n inbox: EMPTY_INBOX,\n needsProvider: null,\n box: null,\n local: { sending: [] },\n history: { anchor: 'end', items: [], hasBefore: false, hasAfter: false, loadingBefore: false, loadingAfter: false, newWhileDetached: 0 },\n sync: { status: 'connecting', cursor: 0, via: null, violations: [] },\n }\n const cfg = sessionConfig(d, o as StreamOptions)\n ;(cfg.has as Record<string, boolean>).history = !!d.history\n // refNonce: os `ref` da fila saem \u00FAnicos entre interfaces (ver `newRef`)\n const wcfg = JSON.stringify({ ...cfg, pageSize: o.pageSize, maxWindow: o.maxWindow, refNonce: uuidv7(d.clock.now()).replace(/-/g, '') })\n // o n\u00FAcleo nasce quando o wasm chegar (peda\u00E7o \u00E0 parte); at\u00E9 l\u00E1 o estado \u00E9 o inicial e as entradas esperam\n this.edge = new Edge(() => new (core().LiveWatch)(wcfg), d, o.chatId, o.random ?? Math.random, (f) => this.handle(f))\n this.unWake = d.env.onWake((why, awayMs) => this.edge.run((c, e) => c.wake(...e, why, awayMs ?? 0)))\n this.edge.run((c, e) => c.start(...e))\n }\n\n // ------------------------------------------------------------------ leitura\n\n getState = (): WatchState<S, I> => this.state\n\n /** Compat\u00EDvel com `useSyncExternalStore(live.subscribe, live.getState)`. */\n subscribe = (cb: Listener<S, I>): (() => void) => {\n this.listeners.add(cb)\n return () => this.listeners.delete(cb)\n }\n\n /** S\u00F3 chama quando o peda\u00E7o escolhido muda (a fila n\u00E3o re-renderiza a cada delta de texto \u2014 T3). */\n select<T>(fn: (s: WatchState<S, I>) => T, cb: (v: T) => void, eq: (a: T, b: T) => boolean = Object.is): () => void {\n let prev = fn(this.state)\n cb(prev)\n return this.subscribe((s) => {\n const next = fn(s)\n if (!eq(prev, next)) {\n prev = next\n cb(next)\n }\n })\n }\n\n /** Eventos aplicados, em ordem (o `prompt()` e o `events()` usam). */\n tap(cb: (evs: Envelope[]) => void): () => void {\n this.eventTaps.add(cb)\n return () => this.eventTaps.delete(cb)\n }\n\n get chatId(): string {\n return this.o.chatId\n }\n\n // ------------------------------------------------------------------ comandos\n\n /** Manda uma mensagem. Aparece na hora em `local.sending`; sai quando a inbox do log a mostra. */\n async send(\n content: string | ContentPart[],\n opts: { mode?: SendMode; attachments?: string[]; messageId?: string } = {},\n ): Promise<SubmitResult & { messageId: string }> {\n const messageId = opts.messageId ?? newMessageId(this.d.clock.now())\n const parts = JSON.stringify(toContentParts(content, opts.attachments))\n const r = await this.wait(`send:${messageId}`, (c, e) => c.send(...e, messageId, parts, opts.mode ?? 'auto'))\n return { ...r, messageId }\n }\n\n stop(): Promise<SubmitResult> {\n const stopId = uuidv7(this.d.clock.now())\n return this.command({ t: 'stop', ref: `stop:${stopId}`, chatId: this.o.chatId, stopId })\n }\n\n respond(requestId: string, answer: unknown): Promise<SubmitResult> {\n return this.command({ t: 'respond', ref: `respond:${requestId}:${uuidv7(this.d.clock.now())}`, chatId: this.o.chatId, requestId, answer })\n }\n\n /** Sess\u00E3o nova do provedor (era o recycle); `clearHistory` tamb\u00E9m esconde o hist\u00F3rico at\u00E9 aqui. */\n reset(opts: { clearHistory?: boolean } = {}): Promise<SubmitResult> {\n const resetId = uuidv7(this.d.clock.now())\n return this.command({ t: 'reset', ref: `reset:${resetId}`, chatId: this.o.chatId, resetId, ...(opts.clearHistory ? { clearHistory: true } : {}) })\n }\n\n /**\n * Troca de agente (\u00A717.4): um comando da fila no MESMO canal ordenado do `send` \u2014 \"troquei e mandei\" chega\n * na ordem, sem esperar nada. O dono aplica antes do pr\u00F3ximo run; uma troca nova substitui a pendente\n * (`queue.pendingSwitch`). A forma \u00E9 a do REST (`agentId`, `model?`, `effort?`): o servidor completa o resto e\n * valida o acesso; `provider`/`agentName` n\u00E3o v\u00E3o (o servidor ignoraria).\n */\n switchAgent(to: SwitchTo): Promise<SubmitResult> {\n const switchId = uuidv7(this.d.clock.now())\n return this.wait(`switch:${switchId}`, (c, e) => c.switch_agent(...e, switchId, JSON.stringify(to)))\n }\n\n /**\n * Troca S\u00D3 modelo/esfor\u00E7o do agente de agora (o que n\u00E3o vier fica o de agora): o mesmo comando `switch`, sem\n * `agentId` \u2014 o servidor completa com o agente atual (a box aplica ao vivo, sem sess\u00E3o nova). `null` = voltar\n * ao padr\u00E3o do agente (vai no frame como `reset`).\n */\n switchModel(change: { model?: string | null; effort?: string | null }): Promise<SubmitResult> {\n const switchId = uuidv7(this.d.clock.now())\n return this.wait(`switch:${switchId}`, (c, e) => c.switch_model(...e, switchId, JSON.stringify(change)))\n }\n\n /** Cancela a troca agendada (`queue.pendingSwitch`): o comando `cancelSwitch`, no mesmo canal ordenado. */\n cancelSwitch(): Promise<SubmitResult> {\n const switchId = uuidv7(this.d.clock.now())\n return this.wait(`switch:${switchId}`, (c, e) => c.cancel_switch(...e, switchId))\n }\n\n resend(messageId: string): Promise<SubmitResult> {\n return this.command({ t: 'resend', ref: newRef(), chatId: this.o.chatId, messageId })\n }\n\n /** Fila: sempre em cima da vers\u00E3o que a tela est\u00E1 vendo; `conflict` traz (e aplica) o estado novo. */\n readonly queue = {\n reorder: (order: string[]) => this.queueOp({ kind: 'reorder', order }),\n edit: (messageId: string, content: string | ContentPart[]) => this.queueOp({ kind: 'edit', messageId, content: toContentParts(content) }),\n remove: (messageId: string) => this.queueOp({ kind: 'remove', messageId }),\n sendNow: (messageId: string) => this.queueOp({ kind: 'sendNow', messageId }),\n }\n\n private queueOp(op: QueueOp): Promise<SubmitResult> {\n if (this.closed) return Promise.reject(new Error('stream closed'))\n return new Promise((resolve, reject) =>\n this.edge.when((c) => this.wait(c.next_queue_ref(), (w, e) => w.queue_op(...e, JSON.stringify(op))).then(resolve, reject)),\n )\n }\n\n private command(frame: { ref: string } & Record<string, unknown>): Promise<SubmitResult> {\n return this.wait(frame.ref, (c, e) => c.command(...e, JSON.stringify(frame)))\n }\n\n private wait(ref: string, input: Input): Promise<SubmitResult> {\n if (this.closed) return Promise.reject(new Error('stream closed'))\n return new Promise((resolve, reject) => {\n this.waiting.set(ref, { resolve, reject })\n this.edge.run(input)\n })\n }\n\n retry(): void {\n this.edge.run((c, e) => c.wake(...e, 'manual', 0))\n }\n\n tokenRenewed(token: string): void {\n this.edge.run((c, e) => c.token_renewed(...e, token))\n }\n\n close(): void {\n if (this.closed) return\n this.edge.run((c, e) => c.close(...e))\n this.closed = true\n this.unWake()\n this.edge.stop()\n this.listeners.clear()\n this.eventTaps.clear()\n }\n\n // ------------------------------------------------------------------ hist\u00F3rico (\u00A74.9)\n\n readonly history = {\n /** Rola pra cima: p\u00E1gina de itens fechados antes do primeiro da janela. */\n loadOlder: (): Promise<void> => this.page((c) => c.load_older()),\n /** S\u00F3 na janela parada: p\u00E1gina depois do \u00FAltimo item; encontrando o ao vivo, recola no fim. */\n loadNewer: (): Promise<void> => this.page((c) => c.load_newer()),\n /** Abre \"em volta\" de uma mensagem ou evento. O ao vivo continua aplicando por baixo. */\n jumpTo: (anchor: { messageId: string } | { eventId: number }): Promise<void> => this.page((c) => c.jump_to(JSON.stringify(anchor))),\n /** Volta pro fim (cola no ao vivo). */\n jumpToEnd: (): Promise<void> => this.page((c) => c.jump_to_end()),\n }\n\n /** Roda um pedido de hist\u00F3rico; resolve quando a p\u00E1gina chegou e foi aplicada (ou na hora, se n\u00E3o pediu). */\n private page(input: (c: LiveWatch) => string): Promise<void> {\n if (this.closed) return Promise.resolve()\n return new Promise<void>((resolve) =>\n this.edge.when((c) => {\n const fx = JSON.parse(input(c)) as OtherFx[]\n const req = fx.find((f) => f.k === 'history')?.req as number | undefined\n if (req === undefined) resolve()\n else this.historyWaiting.set(req, resolve)\n this.edge.exec(fx)\n }),\n )\n }\n\n // ------------------------------------------------------------------ efeitos do n\u00FAcleo\n\n private handle(f: OtherFx): void {\n switch (f.k) {\n case 'patch':\n return this.applyPatch(f.v as Patch)\n case 'tap': {\n const evs = f.v as Envelope[]\n for (const t of this.eventTaps) t(evs)\n return\n }\n case 'history': {\n const req = f.req as number\n const finish = (input: (c: LiveWatch) => string) => {\n if (!this.closed && this.edge.core) this.edge.exec(JSON.parse(input(this.edge.core)) as OtherFx[])\n const w = this.historyWaiting.get(req)\n this.historyWaiting.delete(req)\n w?.()\n }\n this.d.history!(this.o.chatId, f.q as HistoryQuery).then(\n (page) => finish((c) => c.on_history(req, true, JSON.stringify(page))),\n (e: unknown) => finish((c) => c.on_history(req, false, e instanceof Error ? e.message : String(e))),\n )\n return\n }\n case 'onStatus':\n if (f.v === 'auth_failed') this.o.onAuthFailed?.()\n return\n case 'onDebug':\n return this.o.onDebug?.(f.v as DebugEvent)\n case 'onViolation':\n return this.o.onViolation?.(f.v as Violation)\n case 'resolve': {\n const w = this.waiting.get(f.ref as string)\n this.waiting.delete(f.ref as string)\n return w?.resolve(f.v as SubmitResult)\n }\n case 'reject': {\n const w = this.waiting.get(f.ref as string)\n this.waiting.delete(f.ref as string)\n return w?.reject(new Error(String(f.v)))\n }\n }\n }\n\n private applyPatch(p: Patch): void {\n const prev = this.state\n let timeline = prev.timeline as unknown as Record<string, unknown>\n if (p.timeline && 'replace' in p.timeline) {\n timeline = p.timeline.replace\n } else if (p.timeline) {\n const t = p.timeline\n timeline = { ...timeline, ...t.set }\n for (const k of t.del) delete timeline[k]\n if (Object.keys(t.items).length) timeline.items = { ...(timeline.items as Record<string, unknown>), ...t.items }\n }\n let history = prev.history\n if (p.history) {\n const { ids, items, ...flags } = p.history\n for (const [id, it] of Object.entries(items ?? {})) this.pageItems.set(id, it as I)\n this.historyIds = ids\n history = { ...(flags as Omit<HistoryWindow<I>, 'items'>), items: [] }\n }\n if (p.history || p.timeline) {\n const live = (timeline.items ?? {}) as Record<string, I>\n history = { ...history, items: this.historyIds.map((id) => live[id] ?? this.pageItems.get(id)).filter((x): x is I => x !== undefined) }\n }\n this.state = {\n version: p.version,\n timeline: timeline as unknown as S,\n queue: p.queue ?? prev.queue,\n inbox: p.inbox ?? prev.inbox,\n needsProvider: p.needsProvider !== undefined ? p.needsProvider : prev.needsProvider,\n box: p.box !== undefined ? p.box : prev.box,\n local: p.local ? { sending: p.local } : prev.local,\n history,\n sync: p.sync ?? prev.sync,\n }\n for (const l of this.listeners) l(this.state)\n }\n}\n", "// `prompt()` \u2014 o atalho pergunta-e-resposta (DESIGN \u00A72; proposta sdk \u00A73.3), no formato do MessageStream\n// da Anthropic: eventos (`.on`), iterador ass\u00EDncrono e `result`.\n// Regra da v2 (2026-08-02, 2026-10-18): `result` NUNCA rejeita por transporte (a camada religa pelo\n// cursor) e sempre resolve \u2014 inclusive no `cancel()`. S\u00F3 rejeita em erro de PEDIDO (o envio foi recusado).\nimport type { ContentPart, Envelope, SendMode } from './types'\nimport type { LiveChat } from './watch'\n\nexport type RunOutcome = 'completed' | 'stopped' | 'failed' | 'not_delivered' | 'cancelled'\n\nexport interface RunResult {\n status: RunOutcome\n messageId: string\n runId?: string\n text: string\n /** Itens fechados deste run (o `data.item` dos item.completed). */\n items: unknown[]\n usage?: unknown\n error?: unknown\n /** S\u00F3 em `not_delivered`: `not_consumed` = a box dormiu v\u00E1rias vezes sem o provedor ler; ausente = STOP antes do turno. */\n notDeliveredReason?: string\n}\n\nexport type RunEvent =\n | { type: 'queued' }\n | { type: 'started'; runId: string }\n | { type: 'text'; delta: string; text: string }\n | { type: 'item'; item: unknown }\n | { type: 'event'; event: Envelope }\n | { type: 'done'; result: RunResult }\n\nexport class PromptRejectedError extends Error {\n constructor(\n readonly code: string,\n message: string,\n ) {\n super(message)\n this.name = 'PromptRejectedError'\n }\n}\n\ntype Handlers = { [K in RunEvent['type']]?: Array<(e: Extract<RunEvent, { type: K }>) => void> }\n\nexport class RunHandle implements AsyncIterable<RunEvent> {\n readonly result: Promise<RunResult>\n state: 'sending' | 'queued' | 'running' | 'done' = 'sending'\n messageId = ''\n runId: string | undefined\n\n private resolve!: (r: RunResult) => void\n private reject!: (e: Error) => void\n private readonly handlers: Handlers = {}\n private readonly buffer: RunEvent[] = []\n private wakeIterators: Array<() => void> = []\n private text = ''\n private readonly items: unknown[] = []\n private readonly untap: () => void\n private unselect: (() => void) | null = null\n\n constructor(\n private readonly live: LiveChat<unknown, unknown>,\n content: string | ContentPart[],\n opts: { mode?: SendMode; attachments?: string[]; messageId?: string } = {},\n private readonly onSettled?: () => void,\n ) {\n this.result = new Promise((res, rej) => {\n this.resolve = res\n this.reject = rej\n })\n this.result.catch(() => {}) // quem n\u00E3o der await n\u00E3o ganha unhandled rejection\n this.untap = live.tap((evs) => evs.forEach((e) => this.onEvent(e)))\n live\n .send(content, opts)\n .then((r) => {\n this.messageId = r.messageId\n if (r.status === 'rejected') return this.fail(new PromptRejectedError(r.code, r.message))\n if (r.status === 'conflict') return this.fail(new PromptRejectedError('conflict', 'conflict'))\n this.watchQueue()\n })\n .catch((e: Error) => this.fail(e))\n if (opts.messageId) this.messageId = opts.messageId\n }\n\n on<K extends RunEvent['type']>(type: K, cb: (e: Extract<RunEvent, { type: K }>) => void): this {\n ;((this.handlers[type] ??= []) as Array<typeof cb>).push(cb)\n return this\n }\n\n /** STOP do chat (o run \u00E9 dele). O `result` resolve com `stopped` quando o run fechar. */\n stop(): Promise<unknown> {\n return this.live.stop()\n }\n\n /** Para de ouvir; o agente segue. O `result` resolve com `cancelled`. */\n cancel(): void {\n this.settle('cancelled')\n }\n\n [Symbol.asyncIterator](): AsyncIterator<RunEvent> {\n let i = 0\n return {\n next: () =>\n new Promise((resolve) => {\n const pull = () => {\n if (i < this.buffer.length) return resolve({ value: this.buffer[i++]!, done: false })\n if (this.state === 'done') return resolve({ value: undefined, done: true })\n this.wakeIterators.push(pull)\n }\n pull()\n }),\n }\n }\n\n // ------------------------------------------------------------------\n\n private watchQueue(): void {\n // na fila (agente ocupado): a tela pode mostrar \"na fila\" at\u00E9 o run dela come\u00E7ar; STOP antes do turno\n // pegar a mensagem = ela vai pra `inbox.notDelivered` (o app reenvia ou descarta) e o run nunca abre\n const mine = (q: { messageId: string }) => q.messageId === this.messageId\n this.unselect = this.live.select(\n (s) => {\n const nd = (s.queue?.notDelivered?.find(mine) ?? s.inbox.notDelivered?.find(mine)) as { notDeliveredReason?: string } | undefined\n if (nd) return `not_delivered:${nd.notDeliveredReason ?? ''}`\n // \u00A717: o item `queue` espera atr\u00E1s de outro run; o `auto` pendente vai come\u00E7ar (n\u00E3o \u00E9 \"na fila\")\n const q = s.queue?.items?.find(mine)\n return (q && q.mode === 'queue') || s.inbox.queue.some(mine) ? 'queued' : ''\n },\n (where) => {\n if (where.startsWith('not_delivered:') && !this.runId) {\n const reason = where.slice('not_delivered:'.length)\n return this.settle('not_delivered', undefined, undefined, reason || undefined)\n }\n if (where === 'queued' && this.state === 'sending') {\n this.state = 'queued'\n this.emit({ type: 'queued' })\n }\n },\n )\n }\n\n private onEvent(e: Envelope): void {\n if (this.state === 'done') return\n const d = (e.data ?? {}) as Record<string, unknown>\n if (!this.runId) {\n // o run \u00E9 o que abriu pela nossa mensagem (`run.started.trigger.messageIds`) ou aquele em que o\n // provedor a leu (o item `user_message` com o nosso messageId \u2014 steer entra no run ativo)\n const item = d.item as { kind?: string; messageId?: string; runId?: string } | undefined\n const trigger = d.trigger as { messageIds?: string[] } | undefined\n const read = (e.type === 'item.started' || e.type === 'item.completed') && item?.kind === 'user_message' && item.messageId === this.messageId\n if (this.messageId !== '' && ((e.type === 'run.started' && trigger?.messageIds?.includes(this.messageId)) || read)) {\n this.runId = e.runId ?? (d.runId as string | undefined) ?? item?.runId\n if (this.runId) {\n this.state = 'running'\n this.emit({ type: 'started', runId: this.runId })\n }\n }\n if (!this.runId) return\n }\n const runOf = e.runId ?? (d.runId as string | undefined)\n if (runOf !== this.runId) return\n this.emit({ type: 'event', event: e })\n if (e.type === 'item.delta') {\n const delta = d.delta as { path?: string; append?: string } | undefined\n const piece = delta ? (delta.path === 'text' ? delta.append : undefined) : (d.text as string | undefined)\n if (piece) {\n this.text += piece\n this.emit({ type: 'text', delta: piece, text: this.text })\n }\n } else if (e.type === 'item.completed') {\n const item = d.item ?? d\n this.items.push(item)\n this.emit({ type: 'item', item })\n } else if (e.type === 'run.completed') {\n const status = (d.status as RunOutcome | undefined) ?? 'completed'\n this.settle(status, d.usage, d.error)\n }\n }\n\n /**\n * O texto do run = os itens `text` fechados. Um steer no Codex CORTA a resposta em andamento\n * (`steerBoundary: 'model_call'`): o parcial fecha `interrupted` e outra resposta come\u00E7a j\u00E1 com o\n * steer \u2014 a resposta final \u00E9 a que completou; o parcial cortado s\u00F3 entra se n\u00E3o houver outra.\n */\n private finalText(): string {\n const texts = this.items.filter(\n (i): i is { kind: string; text: string; status?: string } =>\n typeof i === 'object' && i !== null && (i as { kind?: unknown }).kind === 'text',\n )\n if (!texts.length) return this.text\n const done = texts.filter((i) => i.status !== 'interrupted')\n return (done.length ? done : texts).map((i) => i.text).join('')\n }\n\n private settle(status: RunOutcome, usage?: unknown, error?: unknown, notDeliveredReason?: string): void {\n if (this.state === 'done') return\n const result: RunResult = {\n status, messageId: this.messageId, text: this.finalText(), items: this.items,\n ...(this.runId ? { runId: this.runId } : {}), ...(usage !== undefined ? { usage } : {}), ...(error !== undefined ? { error } : {}),\n ...(notDeliveredReason ? { notDeliveredReason } : {}),\n }\n this.emit({ type: 'done', result })\n this.state = 'done'\n this.cleanup()\n this.resolve(result)\n }\n\n private fail(e: Error): void {\n if (this.state === 'done') return\n this.state = 'done'\n this.cleanup()\n this.reject(e)\n }\n\n private cleanup(): void {\n this.untap()\n this.unselect?.()\n const wake = this.wakeIterators\n this.wakeIterators = []\n wake.forEach((w) => w())\n this.onSettled?.()\n }\n\n private emit(ev: RunEvent): void {\n this.buffer.push(ev)\n for (const h of (this.handlers[ev.type] ?? []) as Array<(e: RunEvent) => void>) {\n try {\n h(ev)\n } catch {\n /* handler do app n\u00E3o derruba o run */\n }\n }\n const wake = this.wakeIterators\n this.wakeIterators = []\n wake.forEach((w) => w())\n }\n}\n", "// A lista lateral ao vivo (DESIGN \u00A713, P8): o UserFeed do realtime (`GET /v3/me/feed`, um DO por usu\u00E1rio).\n// Protocolo: na conex\u00E3o `{t:'feed', version, rows}` (os 200 mais recentes); depois `{t:'row'}` e\n// `{t:'removed'}`, cada um com `version`. Reconectar = `feed` inteiro de novo (sem replay), ent\u00E3o a\n// SDK s\u00F3 precisa de backoff e de descartar frame com vers\u00E3o velha. O filtro por agente \u00E9 daqui.\n// A regra mora no n\u00FAcleo Rust (sdk/core-rs, `Feed`); aqui \u00E9 a borda.\nimport type { Clock, LiveDeps, LiveEnv, OpenSocket } from './deps'\nimport { Edge, type OtherFx } from './edge'\nimport { core } from './native'\nimport type { LiveFeed } from './wasm/live.js'\nimport type { BoxPresence } from './types'\n\nexport interface ChatRow {\n chatId: string\n agentId: string\n title?: string\n state: string\n waiting?: 'approval' | 'question' | 'input'\n box?: BoxPresence\n lastEventSeq: number\n updatedAt: string\n lastReadSeq: number\n unreadCount: number\n}\n\nexport type FeedFrame =\n | { t: 'feed'; version: number; rows: ChatRow[] }\n | { t: 'row'; version: number; row: ChatRow }\n | { t: 'removed'; version: number; chatId: string }\n | { t: 'hello'; tokenExpiresAt?: number }\n | { t: 'bye'; reason: string; reconnect: string }\n | { t: 'pong' }\n\nexport type FeedStatus = 'connecting' | 'live' | 'reconnecting' | 'offline' | 'auth_failed' | 'forbidden' | 'closed'\n\nexport interface FeedState {\n version: number\n /** Ordenadas por `updatedAt` (mais recente primeiro), j\u00E1 filtradas por agente se pedido. */\n rows: ChatRow[]\n status: FeedStatus\n}\n\nexport interface FeedDeps {\n url: string\n openSocket: OpenSocket\n token(): Promise<string>\n invalidateToken?(): void\n clock: Clock\n env: LiveEnv\n}\n\n/** CASCA FINA sobre o n\u00FAcleo Rust (`Feed`): a borda comum executa o IO; o estado chega pronto. */\nexport class ChatListLive {\n private readonly edge: Edge<LiveFeed>\n private state: FeedState = { version: -1, rows: [], status: 'connecting' }\n private readonly listeners = new Set<(s: FeedState) => void>()\n private readonly unWake: () => void\n private closed = false\n\n constructor(\n private readonly d: FeedDeps,\n filter: { agentId?: string } = {},\n ) {\n const fcfg = JSON.stringify({ url: d.url, ...(filter.agentId ? { agentId: filter.agentId } : {}) })\n const deps: LiveDeps = { connectorUrl: () => d.url, openSocket: d.openSocket, token: d.token, invalidateToken: d.invalidateToken, clock: d.clock, env: d.env }\n this.edge = new Edge(() => new (core().LiveFeed)(fcfg), deps, '', Math.random, (fx: OtherFx) => {\n if (fx.k !== 'feedState') return\n this.state = fx.v as FeedState\n for (const l of this.listeners) l(this.state)\n })\n this.unWake = d.env.onWake((why, awayMs) => this.edge.run((c, e) => c.wake(...e, why, awayMs ?? 0)))\n this.edge.run((c, e) => c.start(...e))\n }\n\n getState = (): FeedState => this.state\n\n subscribe = (cb: (s: FeedState) => void): (() => void) => {\n this.listeners.add(cb)\n return () => this.listeners.delete(cb)\n }\n\n close(): void {\n if (this.closed) return\n this.edge.run((c, e) => c.close(...e))\n this.closed = true\n this.unWake()\n this.edge.stop()\n }\n}\n", "// A cola: monta a camada ao vivo pra uma credencial (token do usu\u00E1rio ou chave). \u00C9 o que\n// `@smoothcodes/agent-client` e `@smoothcodes/agent-server` exp\u00F5em como `chats.watch/events/prompt`.\n// - N `watch(chatId)` na mesma inst\u00E2ncia compartilham UM stream (contagem de refer\u00EAncias);\n// o \u00FAltimo `close()` fecha depois de `keepAliveMs` (T3: assinatura \u00D7 cache t\u00EAm vidas separadas).\n// - O token renovado vai pros sockets abertos sem derrubar.\n// As chamadas REST (hist\u00F3rico, peda\u00E7o do log, snapshot) s\u00E3o `fetch` cru nas rotas do control; quando o contrato\n// consolidar, viram os m\u00E9todos da SDK gerada (proposta sdk \u00A75).\nimport { authedFetch, TokenSource } from './auth'\nimport { serverEnv, systemClock, type Clock, type LiveEnv, type OpenSocket, type SocketLike } from './deps'\nimport type { DebugEvent, Violation } from './stream'\nimport type { ChatSnapshot, ContentPart, Envelope, SendMode } from './types'\nimport { LiveChat, type HistoryPage, type HistoryQuery, type Reducer, type WatchDeps, type WatchOptions } from './watch'\nimport { loadCore } from './native'\nimport { RunHandle } from './prompt'\nimport { ChatStream } from './stream'\nimport type { HistoryPage as ControlHistoryPage } from '../../../generated/ts-client/api/types/HistoryPage'\nimport { ChatListLive } from './feed'\n\nexport interface LiveClientOptions<S, I> {\n /** a base da API, ex. `https://smoothagent-v3-api.uaibuilder.workers.dev` (white-label: s\u00F3 isto muda). */\n baseUrl: string\n token?: string\n getToken?: () => Promise<string>\n /** Ignorado: o reducer \u00E9 o do contrato, no n\u00FAcleo Rust (mantido pra compatibilidade). */\n reducer?: Reducer<S, I>\n fetch?: typeof fetch\n WebSocket?: new (url: string, protocols: string[]) => SocketLike\n clock?: Clock\n env?: LiveEnv\n keepAliveMs?: number\n onDebug?(chatId: string, e: DebugEvent): void\n /** Modo estrito (testes): buraco vira viola\u00E7\u00E3o em vez de resync. */\n strict?: boolean\n onViolation?(chatId: string, v: Violation): void\n /** Revogado: a sess\u00E3o acabou (o app volta pro login dele). */\n onAuthRevoked?(): void\n /** Op\u00E7\u00F5es repassadas a cada stream (testes e ajuste fino). */\n stream?: Partial<Omit<WatchOptions<S, I>, 'chatId' | 'reducer'>>\n}\n\ninterface Entry<S, I> {\n live: LiveChat<S, I>\n refs: number\n closeTimer: unknown\n}\n\nexport class LiveClient<S, I = unknown> {\n readonly tokens: TokenSource\n /** `fetch` com o token e a regra do 401 (a SDK gerada usa o mesmo). */\n readonly fetch: typeof fetch\n private readonly clock: Clock\n private readonly entries = new Map<string, Entry<S, I>>()\n private readonly lists = new Set<ChatListLive>()\n private readonly api: string\n\n constructor(private readonly o: LiveClientOptions<S, I>) {\n this.clock = o.clock ?? systemClock\n this.tokens = new TokenSource({ token: o.token, getToken: o.getToken, clock: this.clock })\n this.fetch = authedFetch(this.tokens, o.fetch ?? globalThis.fetch.bind(globalThis))\n this.api = `${o.baseUrl.replace(/\\/$/, '')}/v3`\n // o n\u00FAcleo (wasm, peda\u00E7o \u00E0 parte) come\u00E7a a baixar j\u00E1, em paralelo com o REST e a tela\n void loadCore().catch(() => {})\n this.tokens.onRenew((t) => {\n for (const e of this.entries.values()) e.live.tokenRenewed(t)\n })\n }\n\n /** O estado ao vivo do chat. Chame `close()` no handle quando a tela desmontar. */\n watch(chatId: string): LiveChat<S, I> & { release(): void } {\n let e = this.entries.get(chatId)\n if (e) {\n e.refs++\n if (e.closeTimer !== null) {\n this.clock.clearTimeout(e.closeTimer)\n e.closeTimer = null\n }\n } else {\n e = { live: new LiveChat(this.deps(), this.watchOptions(chatId)), refs: 1, closeTimer: null }\n this.entries.set(chatId, e)\n }\n const entry = e\n let released = false\n const release = () => {\n if (released) return\n released = true\n this.release(chatId, entry)\n }\n // um handle por chamada (cada tela solta o seu); tudo o mais \u00E9 o LiveChat compartilhado\n return new Proxy(entry.live, {\n get(target, key) {\n if (key === 'release') return release\n if (key === 'close') return release // fechar um handle = soltar a refer\u00EAncia\n const v = Reflect.get(target, key, target) as unknown\n return typeof v === 'function' ? (v as (...a: unknown[]) => unknown).bind(target) : v\n },\n }) as LiveChat<S, I> & { release(): void }\n }\n\n /**\n * Eventos crus, j\u00E1 sem duplicado/buraco e com a troca de transporte. Termina no `return()`/break.\n * - `after`: come\u00E7a DEPOIS deste seq (retomar de onde parou: todo evento de `after+1` em diante, sem snapshot);\n * sem `after`, come\u00E7a no estado atual (o snapshot do servidor; `onSnapshot(seq)` diz at\u00E9 onde ele cobre).\n * - `onSnapshot(seq)`: o servidor mandou um snapshot em vez dos eventos \u2014 os anteriores a `seq` N\u00C3O v\u00EAm\n * (in\u00EDcio sem `after`, ou resync depois de um buraco que n\u00E3o fechou). Nunca pula em sil\u00EAncio (M46).\n * - `includeRaw`: os eventos trazem o `raw` do provedor.\n * Um socket pr\u00F3prio (n\u00E3o o do `watch()`), pra o cursor ser s\u00F3 dele.\n */\n async *events(chatId: string, o: { after?: number; includeRaw?: boolean; onSnapshot?(seq: number): void } = {}): AsyncGenerator<Envelope, void, undefined> {\n const queue: Envelope[] = []\n let wake: (() => void) | null = null\n const stream = new ChatStream(\n this.deps(),\n {\n ...this.o.stream,\n chatId,\n ...(o.includeRaw ? { includeRaw: true } : {}),\n ...(o.after !== undefined ? { resumeFrom: { cursor: o.after, inboxVersion: -1 } } : {}),\n ...(this.o.strict ? { strict: true } : {}),\n },\n {\n events: (evs) => {\n queue.push(...evs)\n wake?.()\n },\n snapshot: (s) => o.onSnapshot?.(s.seq),\n status: (st) => {\n if (st === 'auth_failed') {\n this.tokens.markRevoked()\n this.o.onAuthRevoked?.()\n }\n },\n debug: (e) => this.o.onDebug?.(chatId, e),\n violation: (v) => this.o.onViolation?.(chatId, v),\n },\n )\n const unRenew = this.tokens.onRenew((t) => stream.tokenRenewed(t))\n try {\n for (;;) {\n while (queue.length) yield queue.shift()!\n await new Promise<void>((r) => (wake = r))\n wake = null\n }\n } finally {\n unRenew?.()\n stream.close()\n }\n }\n\n /** Manda e acompanha s\u00F3 esse run. `result` nunca rejeita por transporte. */\n prompt(chatId: string, content: string | ContentPart[], opts: { mode?: SendMode; attachments?: string[]; messageId?: string } = {}): RunHandle {\n const h = this.watch(chatId)\n return new RunHandle(h as unknown as LiveChat<unknown, unknown>, content, opts, () => h.release())\n }\n\n /** A lista lateral ao vivo (UserFeed): t\u00EDtulo, estado, esperando o qu\u00EA, n\u00E3o lidas. Filtro por agente aqui. */\n watchList(filter: { agentId?: string } = {}): ChatListLive {\n const d = this.deps()\n const list = new ChatListLive(\n { url: `${this.api.replace(/^http/, 'ws')}/me/feed`, openSocket: d.openSocket, token: d.token, invalidateToken: d.invalidateToken, clock: d.clock, env: d.env },\n filter,\n )\n this.lists.add(list)\n return list\n }\n\n /** Marca como lido at\u00E9 `seq` (vale pra todos os dispositivos do usu\u00E1rio; o feed atualiza o unreadCount). */\n async markRead(chatId: string, seq: number): Promise<void> {\n await this.json(`/chats/${encodeURIComponent(chatId)}/read`, { method: 'POST', body: JSON.stringify({ seq }), headers: { 'Content-Type': 'application/json' } })\n }\n\n /** Fecha tudo agora. */\n close(): void {\n for (const e of this.entries.values()) {\n if (e.closeTimer !== null) this.clock.clearTimeout(e.closeTimer)\n e.live.close()\n }\n this.entries.clear()\n for (const l of this.lists) l.close()\n this.lists.clear()\n }\n\n private release(chatId: string, e: Entry<S, I>): void {\n if (--e.refs > 0) return\n e.closeTimer = this.clock.setTimeout(() => {\n if (e.refs > 0 || this.entries.get(chatId) !== e) return\n e.live.close()\n this.entries.delete(chatId)\n }, this.o.keepAliveMs ?? 300_000)\n }\n\n private watchOptions(chatId: string): WatchOptions<S, I> {\n return {\n ...this.o.stream,\n chatId,\n\n onDebug: (e) => this.o.onDebug?.(chatId, e),\n ...(this.o.strict ? { strict: true } : {}),\n onViolation: (v) => this.o.onViolation?.(chatId, v),\n onAuthFailed: () => {\n this.tokens.markRevoked()\n this.o.onAuthRevoked?.()\n },\n }\n }\n\n private deps(): WatchDeps {\n const wsBase = this.api.replace(/^http/, 'ws')\n const WS = this.o.WebSocket ?? (globalThis as { WebSocket?: new (u: string, p: string[]) => SocketLike }).WebSocket\n if (!WS) throw new Error('SmoothAgent: sem WebSocket neste ambiente \u2014 passe `WebSocket` nas op\u00E7\u00F5es')\n const openSocket: OpenSocket = (url, protocols) => new WS(url, protocols)\n return {\n connectorUrl: (id) => `${wsBase}/chats/${encodeURIComponent(id)}/live`,\n openSocket,\n token: () => this.tokens.get(),\n invalidateToken: () => this.tokens.invalidate(),\n clock: this.clock,\n env: this.o.env ?? browserEnv() ?? serverEnv,\n eventsRange: (id, from, to) => this.json(`/chats/${encodeURIComponent(id)}/events/range?after=${from - 1}&until=${to}`),\n snapshot: (id) => this.json<ChatSnapshot>(`/chats/${encodeURIComponent(id)}/snapshot`),\n probeAccess: async (id) => {\n const res = await this.fetch(`${this.api}/chats/${encodeURIComponent(id)}`, { headers: { Accept: 'application/json' } })\n if (res.status === 401) return 'unauthorized'\n if (res.status === 403 || res.status === 404) return 'forbidden' // 404 = n\u00E3o existe OU n\u00E3o \u00E9 seu (control n\u00E3o vaza exist\u00EAncia)\n return 'ok'\n },\n history: async (id, q) => fromControlPage(id, await this.json<ControlHistoryPage>(`/chats/${encodeURIComponent(id)}/history?${historyQs(q)}`)),\n }\n }\n\n private async json<T>(path: string, init?: RequestInit): Promise<T> {\n const res = await this.fetch(`${this.api}${path}`, { ...init, headers: { Accept: 'application/json', ...(init?.headers ?? {}) } })\n if (!res.ok) {\n const body = (await res.json().catch(() => ({}))) as { error?: { code?: string; message?: string } }\n throw Object.assign(new Error(body.error?.message ?? `HTTP ${res.status}`), { code: body.error?.code, status: res.status })\n }\n return (await res.json()) as T\n }\n}\n\n/**\n * A p\u00E1gina do `GET /v3/chats/{id}/history` do contrato (tipo GERADO): cada entrada \u00E9 o EVENTO que fechou\n * um item (`entry.event`, um Events.Event) + o `seq` dele. Vira envelope do log e passa pelo reducer do\n * contrato como qualquer evento (`item.completed` traz o item em `data.item`). Ids de evento v\u00EAm em string.\n */\nexport function fromControlPage(_chatId: string, p: ControlHistoryPage): HistoryPage {\n const num = (v: string | number | null | undefined) => (v === null || v === undefined ? null : Number(v))\n return {\n items: p.data.map((entry) => ({ ...(entry.event as unknown as Envelope), seq: entry.seq })),\n firstEventId: num(p.firstEventId),\n lastEventId: num(p.lastEventId),\n hasBefore: p.hasBefore,\n hasAfter: p.hasAfter,\n ...(p.anchorIndex !== undefined ? { anchorIndex: p.anchorIndex } : {}),\n headEventId: num(p.headEventId) ?? 0,\n ...(p.liveFromEventId !== undefined && p.liveFromEventId !== null ? { liveFromEventId: Number(p.liveFromEventId) } : {}),\n }\n}\n\nfunction historyQs(q: HistoryQuery): string {\n const p = new URLSearchParams()\n if (q.limit) p.set('limit', String(q.limit))\n if ('before' in q) p.set('before', String(q.before))\n else if ('after' in q) p.set('after', String(q.after))\n else if ('around' in q) p.set('around', 'messageId' in q.around ? q.around.messageId : String(q.around.eventId))\n else p.set('anchor', 'end')\n return p.toString()\n}\n\n/** Navegador: online/offline, visibilidade e foco viram wakeups (T3 wakeups). */\nfunction browserEnv(): LiveEnv | null {\n const g = globalThis as { document?: Document; navigator?: Navigator; addEventListener?: typeof addEventListener; removeEventListener?: typeof removeEventListener }\n if (!g.document || !g.addEventListener) return null\n const doc = g.document\n return {\n online: () => g.navigator?.onLine !== false,\n visible: () => doc.visibilityState !== 'hidden',\n onWake: (cb) => {\n let hiddenAt: number | null = null\n const onOnline = () => cb('online')\n const onFocus = () => cb('focus')\n const onVis = () => {\n if (doc.visibilityState === 'hidden') hiddenAt = Date.now()\n else {\n cb('visible', hiddenAt === null ? 0 : Date.now() - hiddenAt)\n hiddenAt = null\n }\n }\n g.addEventListener!('online', onOnline)\n g.addEventListener!('focus', onFocus)\n doc.addEventListener('visibilitychange', onVis)\n return () => {\n g.removeEventListener!('online', onOnline)\n g.removeEventListener!('focus', onFocus)\n doc.removeEventListener('visibilitychange', onVis)\n }\n },\n }\n}\n", "// O que as SDKs REST (client e server) somam \u00E0 gerada pelo Fern, sem a camada ao vivo (sem wasm).\n// - Idempotency-Key em TODO pedido que o app n\u00E3o chaveou: o retry do gerador (2\u00D7 em 408/429/5xx) nunca\n// duplica um POST (o control guarda 24 h por credencial; mesmo corpo \u2192 mesma resposta). Auditoria M47.\n// - `send` com o `clientMessageId` gerado uma vez e reenvio sozinho na falha passageira (PLAN sdk 3).\nimport { newMessageId, uuidv7 } from './ids'\nimport type { Clock } from './deps'\nimport { KNOWN_ERROR_CODES } from '../../../../contract/events/ts/src/gen/known'\nimport type { ErrorCode } from './types'\n\n/** Cabe\u00E7alho padr\u00E3o do cliente gerado: uma chave nova por chamada (a mesma em todas as tentativas dela). */\nexport function idempotencyHeaders(): Record<string, () => string> {\n return { 'Idempotency-Key': () => 'idk_' + uuidv7() }\n}\n\n/** Tentativas do `send` al\u00E9m do retry do gerador (que n\u00E3o cobre queda de rede): ~1+2+4+8+16 s. */\nexport const SEND_ATTEMPTS = 6\n\ntype ApiErrorLike = { statusCode?: number; body?: unknown }\n\n/**\n * Falha passageira: rede caiu (sem status), timeout, 408/429/5xx, ou 409 `retryable` (a mesma chave ainda em\n * andamento) \u2014 a menos que o corpo diga `retryable:false`.\n */\nexport function transient(e: unknown, errors: { api: abstract new (...a: never[]) => unknown; timeout: abstract new (...a: never[]) => unknown }): boolean {\n if (e instanceof errors.timeout) return true\n if (!(e instanceof errors.api)) return false\n const { statusCode, body } = e as ApiErrorLike\n const retryable = (body as { error?: { retryable?: boolean } } | undefined)?.error?.retryable\n if (retryable === false) return false\n if (statusCode === 409) return retryable === true\n return statusCode === undefined || statusCode === 408 || statusCode === 429 || statusCode >= 500\n}\n\n/** O corpo de erro do contrato (`{ error: ErrorBody }`, \u00A76). */\nexport interface ApiErrorBody {\n code: ErrorCode\n message: string\n retryable: boolean\n /** o campo culpado em `invalid_request` */\n param?: string\n requestId?: string\n /** dados do c\u00F3digo: `reason`, `resetsAt`, `scope`\u2026 */\n details?: Record<string, unknown>\n}\n\n/**\n * O corpo tipado de um erro do REST (`SmoothAgentApiError`), ou `undefined` se n\u00E3o for um (rede, timeout,\n * outro erro). C\u00F3digo fora da lista do \u00A76 vira `internal` (vers\u00E3o nova do servidor n\u00E3o quebra a tela).\n */\nexport function apiErrorBody(e: unknown): ApiErrorBody | undefined {\n const err = (e as { body?: { error?: Partial<ApiErrorBody> } } | null)?.body?.error\n if (!err || typeof err !== 'object' || typeof err.code !== 'string') return undefined\n return { ...err, code: ((KNOWN_ERROR_CODES as readonly string[]).includes(err.code) ? err.code : 'internal') as ErrorCode, message: String(err.message ?? ''), retryable: err.retryable === true } as ApiErrorBody\n}\n\n/**\n * Faz o `send` at\u00E9 gravar: o `clientMessageId` \u00E9 gerado UMA vez (antes do 1\u00BA envio) e vira tamb\u00E9m a\n * Idempotency-Key; na falha passageira repete o MESMO pedido com espera. O log responde `duplicate`/a mesma\n * resposta se o primeiro j\u00E1 tinha gravado.\n */\nexport function sendBody<R extends { clientMessageId?: string; 'Idempotency-Key'?: string }>(req: R): R & { clientMessageId: string; 'Idempotency-Key': string } {\n const clientMessageId = req.clientMessageId ?? newMessageId()\n return { ...req, clientMessageId, 'Idempotency-Key': req['Idempotency-Key'] ?? clientMessageId }\n}\n\nexport async function untilStored<T>(\n call: () => Promise<T>,\n o: { clock: Clock; abortSignal?: AbortSignal; isTransient(e: unknown): boolean; attempts?: number },\n): Promise<T> {\n const attempts = o.attempts ?? SEND_ATTEMPTS\n for (let n = 0; ; n++) {\n try {\n return await call()\n } catch (e) {\n if (n + 1 >= attempts || !o.isTransient(e) || o.abortSignal?.aborted) throw e\n await new Promise<void>((res) => o.clock.setTimeout(res, 1_000 * 2 ** n * (0.75 + 0.5 * Math.random())))\n }\n }\n}\n", "// Provedores de um dono \u2014 o usu\u00E1rio (`/me/providers`) ou uma conex\u00E3o do workspace (`/connections/{id}`) \u2014 prontos pra\n// tela (DESIGN \u00A718 regra 4: \"provedores do usu\u00E1rio v\u00EAm prontos da SDK\"). A tela s\u00F3 desenha `getState()`.\n//\n// Mora aqui (TS, sobre o REST gerado) e n\u00E3o no n\u00FAcleo Rust: \u00E9 orquestra\u00E7\u00E3o de REST + rel\u00F3gio, sem estado da camada ao\n// vivo; o wasm s\u00F3 entra no `watch` (DESIGN \u00A714, M49) \u2014 mesmo lugar do `untilStored` (rest.ts). Uma fonte s\u00F3: o mesmo\n// c\u00F3digo serve o @smoothcodes/agent-client e o @smoothcodes/agent-server, e os dois donos.\n//\n// Seguran\u00E7a (\u00A716): o c\u00F3digo do OAuth e a chave passam direto pro pedido; nunca entram no estado, em erro, em log nem\n// em nada que a SDK guarde. A URL do login s\u00F3 sai se for http(s).\nimport type { Clock } from './deps'\nimport { apiErrorBody } from './rest'\n\n/** Um provedor como a API devolve (`/me/providers` ou dentro de uma conex\u00E3o). */\nexport interface ProviderRow {\n provider: string\n connected: boolean\n via: string[]\n expiresAt?: string | null\n /** ok | expiring (renova sozinho no pr\u00F3ximo uso) | dead (reconectar) | disconnected. */\n status: 'ok' | 'expiring' | 'dead' | 'disconnected'\n message?: string\n models: { id: string; name?: string }[]\n connect: string[]\n /** `/me/providers`: algum agente do usu\u00E1rio roda neste provedor. Ausente nas conex\u00F5es do workspace. */\n needed?: boolean\n}\n\n/** O in\u00EDcio de um login, como a API devolve (`connect`). */\nexport type LoginStart =\n | { kind: 'oauth'; loginId: string; url: string; expiresAt: string }\n | { kind: 'device'; loginId: string; url: string; userCode: string; expiresAt: string }\n\n/** As rotas de UM dono. A cola (client/server) monta isto com o REST gerado. */\nexport interface ProviderEndpoints {\n list(): Promise<ProviderRow[]>\n connect(provider: string): Promise<LoginStart>\n complete(loginId: string, code: string): Promise<unknown>\n loginStatus(loginId: string): Promise<{ status: string; error?: { code?: string; message?: string } }>\n setKey(provider: string, key: string): Promise<unknown>\n disconnect(provider: string, via?: 'subscription' | 'key'): Promise<unknown>\n}\n\n/** O estado de um fluxo de conectar. `error` no pending = falha que d\u00E1 pra tentar de novo (c\u00F3digo errado, rede). */\nexport type ConnectState =\n | { status: 'starting'; provider: string }\n | { status: 'pending'; provider: string; kind: 'oauth'; url: string; expiresAt: string; submitting: boolean; error?: string }\n | { status: 'pending'; provider: string; kind: 'device'; userCode: string; verificationUrl: string; expiresAt: string; error?: string }\n | { status: 'connected'; provider: string }\n | { status: 'expired'; provider: string }\n | { status: 'failed'; provider: string; message: string; code?: string }\n | { status: 'cancelled'; provider: string }\n\nexport type ConnectStatus = ConnectState['status']\nconst TERMINAL: ReadonlySet<ConnectStatus> = new Set(['connected', 'expired', 'failed', 'cancelled'])\n\n/** Um login em andamento. `subscribe`/`getState` servem o `useSyncExternalStore`. */\nexport interface ConnectFlow {\n readonly provider: string\n getState(): ConnectState\n subscribe(fn: (s: ConnectState) => void): () => void\n /** S\u00F3 OAuth: o c\u00F3digo que o site mostrou. C\u00F3digo errado = continua `pending` com `error` (cole de novo). */\n complete(code: string): Promise<ConnectState>\n /** Para de esperar (o login no servidor vence sozinho). */\n cancel(): void\n /** Resolve no estado final: connected | expired | failed | cancelled. Nunca rejeita. */\n readonly done: Promise<ConnectState>\n}\n\n/** Um provedor na tela: a linha da API + o fluxo de conectar dele + a a\u00E7\u00E3o de chave/desconectar em curso. */\nexport interface ProviderEntry extends ProviderRow {\n /** Em que se\u00E7\u00E3o desenhar (ver `sortProviders`). */\n group: ProviderGroup\n /** O login aberto (ou o \u00FAltimo que falhou/venceu, at\u00E9 o pr\u00F3ximo `connect`/`dismiss`). */\n flow: ConnectState | null\n /** `setKey`/`disconnect` em curso. */\n busy: 'key' | 'disconnect' | null\n /** O erro da \u00FAltima `setKey`/`disconnect` (limpo na pr\u00F3xima a\u00E7\u00E3o). */\n error: string | null\n}\n\nexport interface ProvidersState {\n /** Ordenada: os que algum agente do usu\u00E1rio usa (`needed`) primeiro, depois os outros, na ordem da API. */\n rows: ProviderEntry[]\n loading: boolean\n /** Falha ao carregar a lista. */\n error: string | null\n}\n\nexport interface ProviderSetOptions {\n clock: Clock\n /** Os provedores do agente/chat aberto (ex.: `agent.needs` ou `[agent.provider]`): v\u00EAm primeiro. Troque com `setPrimary`. */\n primary?: readonly string[]\n /** Intervalo do poll do device (padr\u00E3o 2 s). */\n pollMs?: number\n /** Folga sobre o `expiresAt` do servidor antes de dar `expired` localmente (rel\u00F3gio do aparelho torto; padr\u00E3o 30 s). */\n graceMs?: number\n}\n\nexport const PROVIDER_POLL_MS = 2_000\nconst GRACE_MS = 30_000\n\n/** O grupo da linha na tela: os do agente/chat (`primary`), os que algum agente do usu\u00E1rio usa (`needed`), o resto. */\nexport type ProviderGroup = 'primary' | 'needed' | 'other'\n\nexport const groupOf = (r: { provider: string; needed?: boolean }, primary: readonly string[] = []): ProviderGroup =>\n primary.includes(r.provider) ? 'primary' : r.needed === true ? 'needed' : 'other'\n\n/** Ordena: `primary` (na ordem dada) \u2192 `needed` \u2192 o resto; est\u00E1vel. A lista nunca \u00E9 filtrada. */\nexport function sortProviders<R extends { provider: string; needed?: boolean }>(rows: readonly R[], primary: readonly string[] = []): R[] {\n const p = rows.filter((r) => primary.includes(r.provider)).sort((a, b) => primary.indexOf(a.provider) - primary.indexOf(b.provider))\n return [...p, ...rows.filter((r) => groupOf(r, primary) === 'needed'), ...rows.filter((r) => groupOf(r, primary) === 'other')]\n}\n\n/** Texto curto de um erro do REST pra tela (sem nada do pedido). */\nexport function errorMessage(e: unknown): string {\n const b = apiErrorBody(e)\n if (b?.message) return b.message\n if (e instanceof Error && e.message) return e.message\n return 'falhou'\n}\n\n/** S\u00F3 http(s): URL de login com outro esquema (javascript:, data:) n\u00E3o chega na tela. */\nexport function safeLoginUrl(url: unknown): string | null {\n if (typeof url !== 'string') return null\n try {\n const u = new URL(url)\n return u.protocol === 'https:' || u.protocol === 'http:' ? u.href : null\n } catch {\n return null\n }\n}\n\n/** Erro que n\u00E3o adianta repetir (4xx que n\u00E3o seja 408/429): o poll para. Rede/5xx = tenta de novo. */\nfunction permanent(e: unknown): boolean {\n const status = (e as { statusCode?: number } | null)?.statusCode\n const b = apiErrorBody(e)\n if (b && b.retryable) return false\n return typeof status === 'number' && status >= 400 && status < 500 && status !== 408 && status !== 429\n}\n\nclass Flow implements ConnectFlow {\n private state: ConnectState\n private subs = new Set<(s: ConnectState) => void>()\n private timer: unknown = null\n private deadline: unknown = null\n private loginId: string | null = null\n private resolveDone!: (s: ConnectState) => void\n readonly done: Promise<ConnectState>\n\n constructor(\n readonly provider: string,\n private readonly ep: ProviderEndpoints,\n private readonly o: Required<Omit<ProviderSetOptions, 'primary'>>,\n private readonly onEnd: (s: ConnectState) => void,\n ) {\n this.state = { status: 'starting', provider }\n this.done = new Promise((r) => (this.resolveDone = r))\n void this.start()\n }\n\n getState = (): ConnectState => this.state\n\n subscribe = (fn: (s: ConnectState) => void): (() => void) => {\n this.subs.add(fn)\n return () => this.subs.delete(fn)\n }\n\n private get ended(): boolean {\n return TERMINAL.has(this.state.status)\n }\n\n private set(s: ConnectState): void {\n if (this.ended) return\n this.state = s\n for (const fn of [...this.subs]) fn(s)\n if (this.ended) {\n this.clearTimers()\n this.resolveDone(s)\n this.onEnd(s)\n }\n }\n\n private clearTimers(): void {\n if (this.timer !== null) this.o.clock.clearTimeout(this.timer)\n if (this.deadline !== null) this.o.clock.clearTimeout(this.deadline)\n this.timer = this.deadline = null\n }\n\n private async start(): Promise<void> {\n let f: LoginStart\n try {\n f = await this.ep.connect(this.provider)\n } catch (e) {\n this.set({ status: 'failed', provider: this.provider, message: errorMessage(e), ...errCode(e) })\n return\n }\n if (this.ended) return // cancelado enquanto abria\n const url = safeLoginUrl(f.url)\n if (!url) {\n this.set({ status: 'failed', provider: this.provider, message: 'o servidor mandou uma URL de login inv\u00E1lida' })\n return\n }\n this.loginId = f.loginId\n this.armDeadline(f.expiresAt)\n if (f.kind === 'oauth') {\n this.set({ status: 'pending', provider: this.provider, kind: 'oauth', url, expiresAt: f.expiresAt, submitting: false })\n } else {\n this.set({ status: 'pending', provider: this.provider, kind: 'device', userCode: f.userCode, verificationUrl: url, expiresAt: f.expiresAt })\n this.schedulePoll()\n }\n }\n\n private armDeadline(expiresAt: string): void {\n const at = Date.parse(expiresAt)\n if (!Number.isFinite(at)) return\n // o servidor \u00E9 a verdade (o poll/complete dizem `expired`); o prazo local s\u00F3 garante que a tela n\u00E3o espera pra sempre\n const ms = Math.max(0, at - this.o.clock.now()) + this.o.graceMs\n this.deadline = this.o.clock.setTimeout(() => {\n this.deadline = null\n this.set({ status: 'expired', provider: this.provider })\n }, ms)\n }\n\n private schedulePoll(): void {\n if (this.ended) return\n this.timer = this.o.clock.setTimeout(() => {\n this.timer = null\n void this.poll()\n }, this.o.pollMs)\n }\n\n private async poll(): Promise<void> {\n if (this.ended || !this.loginId) return\n try {\n const s = await this.ep.loginStatus(this.loginId)\n if (this.ended) return\n if (s.status === 'completed') return this.set({ status: 'connected', provider: this.provider })\n if (s.status === 'expired') return this.set({ status: 'expired', provider: this.provider })\n if (s.status === 'failed')\n return this.set({ status: 'failed', provider: this.provider, message: s.error?.message || 'o login falhou', ...(s.error?.code ? { code: s.error.code } : {}) })\n if (this.state.status === 'pending' && this.state.error) this.patch({ error: undefined })\n } catch (e) {\n if (this.ended) return\n if (permanent(e)) return this.set({ status: 'failed', provider: this.provider, message: errorMessage(e), ...errCode(e) })\n this.patch({ error: errorMessage(e) }) // rede/5xx: mostra e continua esperando\n }\n this.schedulePoll()\n }\n\n private patch(p: { error?: string; submitting?: boolean }): void {\n if (this.state.status !== 'pending') return\n const next = { ...this.state, ...p } as ConnectState & { error?: string }\n if (p.error === undefined && 'error' in p) delete next.error\n this.set(next)\n }\n\n complete = async (code: string): Promise<ConnectState> => {\n const s = this.state\n if (s.status !== 'pending' || s.kind !== 'oauth' || !this.loginId) return s\n const c = String(code ?? '').trim()\n if (!c) {\n this.patch({ error: 'cole o c\u00F3digo que o site mostrou' })\n return this.state\n }\n if (s.submitting) return s\n this.patch({ submitting: true, error: undefined })\n try {\n await this.ep.complete(this.loginId, c)\n this.set({ status: 'connected', provider: this.provider })\n } catch (e) {\n if (this.ended) return this.state\n const b = apiErrorBody(e)\n const st = (b?.details as { status?: string } | undefined)?.status\n // login vencido/usado ou que n\u00E3o \u00E9 mais deste usu\u00E1rio = acabou; c\u00F3digo errado / rede = cola de novo\n if (st === 'expired') this.set({ status: 'expired', provider: this.provider })\n else if (st === 'completed' || st === 'failed' || b?.code === 'not_found' || b?.code === 'forbidden')\n this.set({ status: 'failed', provider: this.provider, message: errorMessage(e), ...errCode(e) })\n else this.patch({ submitting: false, error: errorMessage(e) })\n }\n return this.state\n }\n\n cancel = (): void => {\n this.set({ status: 'cancelled', provider: this.provider })\n }\n}\n\nconst errCode = (e: unknown): { code?: string } => {\n const c = apiErrorBody(e)?.code\n return c ? { code: c } : {}\n}\n\n/**\n * Os provedores de UM dono, prontos pra tela: lista ordenada, conectar (OAuth/device, com o poll aqui dentro), chave,\n * desconectar. Recarrega a lista sozinho depois de cada mudan\u00E7a. `release()` quando a tela desmontar.\n */\nexport class ProviderSet {\n private state: ProvidersState = { rows: [], loading: true, error: null }\n private raw: ProviderRow[] = []\n private flows = new Map<string, Flow>()\n private last = new Map<string, ConnectState>()\n private busy = new Map<string, 'key' | 'disconnect'>()\n private errors = new Map<string, string>()\n private subs = new Set<(s: ProvidersState) => void>()\n private loadSeq = 0\n private released = false\n private readonly o: Required<Omit<ProviderSetOptions, 'primary'>>\n private primary: readonly string[]\n\n constructor(\n private readonly ep: ProviderEndpoints,\n o: ProviderSetOptions,\n ) {\n this.o = { pollMs: PROVIDER_POLL_MS, graceMs: GRACE_MS, clock: o.clock, ...(o.pollMs !== undefined ? { pollMs: o.pollMs } : {}), ...(o.graceMs !== undefined ? { graceMs: o.graceMs } : {}) }\n this.primary = [...(o.primary ?? [])]\n void this.reload()\n }\n\n getState = (): ProvidersState => this.state\n\n subscribe = (fn: (s: ProvidersState) => void): (() => void) => {\n this.subs.add(fn)\n return () => this.subs.delete(fn)\n }\n\n /** Busca a lista de novo (a resposta mais nova vence). */\n reload = async (): Promise<void> => {\n if (this.released) return\n const seq = ++this.loadSeq\n this.emit({ loading: true })\n try {\n const rows = await this.ep.list()\n if (seq !== this.loadSeq || this.released) return\n this.raw = rows\n this.emit({ loading: false, error: null })\n } catch (e) {\n if (seq !== this.loadSeq || this.released) return\n this.emit({ loading: false, error: errorMessage(e) })\n }\n }\n\n /** Abre o login: Claude \u2192 `oauth` (abra `url`, cole o c\u00F3digo em `complete`); Codex \u2192 `device` (mostre `userCode`). */\n connect = (provider: string): ConnectFlow => {\n this.flows.get(provider)?.cancel()\n this.last.delete(provider)\n const f = new Flow(provider, this.ep, this.o, (end) => {\n if (this.flows.get(provider) !== f) return\n this.flows.delete(provider)\n if (end.status === 'failed' || end.status === 'expired') this.last.set(provider, end)\n this.emit({})\n if (end.status === 'connected') void this.reload()\n })\n this.flows.set(provider, f)\n f.subscribe(() => this.emit({}))\n this.emit({})\n return f\n }\n\n /** O login aberto deste provedor, se houver. */\n flow(provider: string): ConnectFlow | null {\n return this.flows.get(provider) ?? null\n }\n\n /** Troca os provedores que v\u00EAm primeiro (o chat mudou de agente). N\u00E3o busca de novo. */\n setPrimary = (primary: readonly string[] | undefined): void => {\n this.primary = [...(primary ?? [])]\n this.emit({})\n }\n\n /** Some com o erro/expirado que ficou na linha. */\n dismiss = (provider: string): void => {\n this.last.delete(provider)\n this.errors.delete(provider)\n this.emit({})\n }\n\n /** Chave pr\u00F3pria. Rejeita com o erro da API (e o deixa na linha); a chave nunca fica guardada. */\n setKey = (provider: string, key: string): Promise<void> => this.act(provider, 'key', () => this.ep.setKey(provider, String(key ?? '').trim()))\n\n disconnect = (provider: string, via?: 'subscription' | 'key'): Promise<void> => this.act(provider, 'disconnect', () => this.ep.disconnect(provider, via))\n\n /** Cancela os logins abertos e para de avisar. */\n release = (): void => {\n this.released = true\n for (const f of [...this.flows.values()]) f.cancel()\n this.flows.clear()\n this.subs.clear()\n }\n\n private async act(provider: string, kind: 'key' | 'disconnect', call: () => Promise<unknown>): Promise<void> {\n this.busy.set(provider, kind)\n this.errors.delete(provider)\n this.emit({})\n try {\n await call()\n } catch (e) {\n this.errors.set(provider, errorMessage(e))\n throw e\n } finally {\n this.busy.delete(provider)\n this.emit({})\n }\n await this.reload()\n }\n\n private emit(p: Partial<ProvidersState>): void {\n if (this.released) return\n const rows = sortProviders(this.raw, this.primary).map((r) => ({\n ...r,\n group: groupOf(r, this.primary),\n flow: this.flows.get(r.provider)?.getState() ?? this.last.get(r.provider) ?? null,\n busy: this.busy.get(r.provider) ?? null,\n error: this.errors.get(r.provider) ?? null,\n }))\n this.state = { ...this.state, ...p, rows }\n for (const fn of [...this.subs]) fn(this.state)\n }\n}\n\n// \u2500\u2500\u2500 a cola com o REST gerado (client e server t\u00EAm os mesmos nomes; tipado pela forma, sem importar o gerado) \u2500\u2500\u2500\n\ntype Method = (req: never, opts?: never) => PromiseLike<unknown>\n\n/** O que a SDK gerada tem pra `/me/providers` (o mesmo no client e no server). */\nexport type GeneratedMyProviders = Record<\n 'myProvidersList' | 'myProvidersConnect' | 'myProvidersComplete' | 'myProvidersLoginStatus' | 'myProvidersSetKey' | 'myProvidersDisconnect',\n Method\n>\n\n/** O que a SDK gerada (server) tem pra `/connections`. */\nexport type GeneratedConnections = Record<'get' | 'connect' | 'complete' | 'loginStatus' | 'setKey' | 'disconnect', Method>\n\n/** Chama o m\u00E9todo COMO m\u00E9todo (a gerada usa `this`). */\nconst call = async <T>(g: Record<string, Method>, name: string, req: Record<string, unknown> = {}): Promise<T> =>\n (await (g[name] as unknown as (r: Record<string, unknown>) => PromiseLike<unknown>).call(g, req)) as T\nconst rowsOf = (r: unknown): ProviderRow[] => (Array.isArray(r) ? r : ((r as { data?: ProviderRow[] } | null)?.data ?? [])) as ProviderRow[]\nconst viaOpt = (via?: string) => (via ? { via } : {})\ntype Status = Awaited<ReturnType<ProviderEndpoints['loginStatus']>>\n\n/** As rotas do usu\u00E1rio (`/me/providers`), com a gerada. */\nexport function myProviderEndpoints(g: GeneratedMyProviders): ProviderEndpoints {\n return {\n list: async () => rowsOf(await call(g, 'myProvidersList')),\n connect: (provider) => call<LoginStart>(g, 'myProvidersConnect', { provider }),\n complete: (loginId, code) => call(g, 'myProvidersComplete', { loginId, code }),\n loginStatus: (loginId) => call<Status>(g, 'myProvidersLoginStatus', { loginId }),\n setKey: (provider, key) => call(g, 'myProvidersSetKey', { provider, key }),\n disconnect: (provider, via) => call(g, 'myProvidersDisconnect', { provider, ...viaOpt(via) }),\n }\n}\n\n/** As rotas de uma conex\u00E3o do workspace (`/connections/{id}`), com a gerada: a mesma forma do usu\u00E1rio. */\nexport function connectionProviderEndpoints(g: GeneratedConnections, id: string): ProviderEndpoints {\n return {\n list: async () => (await call<{ providers?: ProviderRow[] }>(g, 'get', { id })).providers ?? [],\n connect: (provider) => call<LoginStart>(g, 'connect', { id, provider }),\n complete: (loginId, code) => call(g, 'complete', { id, loginId, code }),\n loginStatus: (loginId) => call<Status>(g, 'loginStatus', { id, loginId }),\n setKey: (provider, key) => call(g, 'setKey', { id, provider, key }),\n disconnect: (provider, via) => call(g, 'disconnect', { id, provider, ...viaOpt(via) }),\n }\n}\n\n/** A gerada + m\u00E9todos a mais (os da gerada continuam presos a ela). */\nexport function withExtra<G extends object, E extends object>(gen: G, extra: E): G & E {\n return new Proxy(gen, {\n get(target, key) {\n if (key in extra) return (extra as Record<PropertyKey, unknown>)[key]\n const v = Reflect.get(target, key, target) as unknown\n return typeof v === 'function' ? (v as (...a: unknown[]) => unknown).bind(target) : v\n },\n }) as G & E\n}\n", "// @smoothcodes/agent-client \u2014 a SDK do usu\u00E1rio (DESIGN \u00A72; proposta sdk \u00A73.1).\n// REST = o que o Fern gera do contrato (audience `client`); ao vivo = o core-live escrito \u00E0 m\u00E3o\n// (watch/events/prompt), com o reducer do contrato. O dev s\u00F3 renderiza.\nimport { SmoothAgentApiClient, SmoothAgentApiEnvironment, SmoothAgentApiError, SmoothAgentApiTimeoutError } from '../../../generated/ts-client/index.js'\nimport { HttpResponsePromise } from '../../../generated/ts-client/core/fetcher/HttpResponsePromise.js'\nimport {\n LiveClient,\n systemClock,\n type Clock,\n type DebugEvent,\n type ChatListLive,\n type LiveChat,\n type LiveEnv,\n type RunHandle,\n type SendMode,\n type SocketLike,\n type Violation,\n} from '../../core-live/src/index'\nimport type { ContractChatState, ContractItem } from '../../core-live/src/reducers/contract'\nimport { idempotencyHeaders, sendBody, transient, untilStored } from '../../core-live/src/rest'\nimport { ProviderSet, myProviderEndpoints, withExtra, type GeneratedMyProviders } from '../../core-live/src/providers'\n\nexport interface SmoothAgentOptions {\n /** Token do usu\u00E1rio (um por dispositivo). Passe este ou `getToken`. */\n token?: string\n /** Renova\u00E7\u00E3o: chamado no in\u00EDcio, perto do `exp` e no 401 `expired` (o backend do dev emite outro). */\n getToken?: () => Promise<string>\n /** White-label: s\u00F3 isto muda. Padr\u00E3o: produ\u00E7\u00E3o. */\n baseUrl?: string\n fetch?: typeof fetch\n WebSocket?: new (url: string, protocols: string[]) => SocketLike\n /** Avisado uma vez quando o token foi revogado (o app volta pro login dele). */\n onAuthRevoked?(): void\n onDebug?(chatId: string, e: DebugEvent): void\n /** Modo estrito (testes): buraco que n\u00E3o fecha vira viola\u00E7\u00E3o (`onViolation`, `sync.violations`) em vez de resync. */\n strict?: boolean\n onViolation?(chatId: string, v: Violation): void\n /** Testes e ambientes sem navegador. */\n clock?: Clock\n env?: LiveEnv\n}\n\nexport type ChatLive = LiveChat<ContractChatState, ContractItem> & { release(): void }\n\n/** A base de produ\u00E7\u00E3o = o `servers` do contrato (sem o `/v3`); white-label passa `baseUrl`. */\nexport const DEFAULT_BASE_URL: string = SmoothAgentApiEnvironment.Default.replace(/\\/v3$/, '')\n\ntype GeneratedChats = SmoothAgentApiClient['chats']\ntype SendInput = Parameters<GeneratedChats['send']>[0]\n\nexport interface ChatsLive {\n /** O estado pronto da tela (snapshot + eventos aplicados + fila + box + hist\u00F3rico paginado). */\n watch(chatId: string): ChatLive\n /** Eventos crus, j\u00E1 sem duplicado/buraco e com a troca box\u2194conector. */\n events(chatId: string, opts?: { after?: number; includeRaw?: boolean; onSnapshot?(seq: number): void }): AsyncGenerator<import('../../core-live/src/index').Envelope, void, undefined>\n /** Manda e acompanha s\u00F3 esse run; `result` nunca rejeita por queda. */\n prompt(chatId: string, content: string, opts?: { mode?: SendMode; attachments?: string[]; messageId?: string }): RunHandle\n /** A lista lateral ao vivo (estado, esperando o qu\u00EA, n\u00E3o lidas), opcionalmente de um agente s\u00F3. */\n watchList(filter?: { agentId?: string }): ChatListLive\n /** Marca como lido at\u00E9 o evento `seq` (todos os dispositivos). */\n markRead(chatId: string, seq: number): Promise<void>\n}\n\ntype GeneratedProviders = SmoothAgentApiClient['providers']\n\nexport interface ProvidersLive {\n /**\n * Os provedores DO USU\u00C1RIO prontos pra tela (`/me/providers`): lista ordenada (`needed` primeiro), conectar\n * (OAuth/device, com o poll dentro da SDK), chave e desconectar; recarrega sozinho. `release()` ao desmontar.\n */\n watch(opts?: { primary?: readonly string[] }): ProviderSet\n}\n\nexport class SmoothAgent {\n /** O cliente REST gerado (todas as rotas da audience `client`). */\n readonly api: SmoothAgentApiClient\n readonly live: LiveClient<ContractChatState, ContractItem>\n readonly chats: GeneratedChats & ChatsLive\n readonly providers: GeneratedProviders & ProvidersLive\n\n constructor(o: SmoothAgentOptions) {\n const baseUrl = (o.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/$/, '')\n this.live = new LiveClient({\n baseUrl,\n token: o.token,\n getToken: o.getToken,\n\n fetch: o.fetch,\n WebSocket: o.WebSocket,\n clock: o.clock,\n env: o.env,\n onAuthRevoked: o.onAuthRevoked,\n onDebug: o.onDebug,\n strict: o.strict,\n onViolation: o.onViolation,\n })\n const tokens = this.live.tokens\n // o mesmo TokenSource no REST e nos sockets: uma renova\u00E7\u00E3o s\u00F3, 401 expired repete uma vez\n this.api = new SmoothAgentApiClient({\n baseUrl: `${baseUrl}/v3`,\n token: () => tokens.get(),\n fetch: this.live.fetch,\n headers: idempotencyHeaders(),\n })\n this.chats = chatsFacade(this.api.chats, this.live, o.clock ?? systemClock)\n const clock = o.clock ?? systemClock\n const gp = this.api.providers\n this.providers = withExtra(gp, { watch: (w?: { primary?: readonly string[] }) => new ProviderSet(myProviderEndpoints(gp as unknown as GeneratedMyProviders), { clock, ...(w?.primary ? { primary: w.primary } : {}) }) })\n }\n\n get agents() {\n return this.api.agents\n }\n get files() {\n return this.api.files\n }\n get machines() {\n return this.api.machines\n }\n get me() {\n return this.api.identity\n }\n\n /** Fecha todos os sockets. */\n close(): void {\n this.live.close()\n }\n}\n\n/**\n * `chats` = a gerada + o ao vivo. O `send` ganha o `clientMessageId` (msg_<uuidv7>) e a mesma\n * `Idempotency-Key` quando o app n\u00E3o passa: o retry do gerador e o reenvio da SDK nunca duplicam. Falha\n * passageira (ex.: 503 \"Network connection lost\", rede que caiu no meio) = reenvia SOZINHO o mesmo pedido\n * (mesmo id, mesma chave); o servidor responde `duplicate` se o primeiro j\u00E1 tinha gravado.\n */\nfunction chatsFacade(gen: GeneratedChats, live: LiveClient<ContractChatState, ContractItem>, clock: Clock): GeneratedChats & ChatsLive {\n const extra: ChatsLive & { send: GeneratedChats['send'] } = {\n watch: (chatId) => live.watch(chatId),\n events: (chatId, opts) => live.events(chatId, opts),\n prompt: (chatId, content, opts) => live.prompt(chatId, content, opts),\n watchList: (filter) => live.watchList(filter),\n markRead: (chatId, seq) => live.markRead(chatId, seq),\n send: ((req: SendInput, ro?: Parameters<GeneratedChats['send']>[1]) => {\n const body = sendBody(req as SendInput & { clientMessageId?: string; 'Idempotency-Key'?: string }) as SendInput\n const isTransient = (e: unknown) => transient(e, { api: SmoothAgentApiError, timeout: SmoothAgentApiTimeoutError })\n return HttpResponsePromise.fromPromise(untilStored(() => gen.send(body, ro).withRawResponse(), { clock, abortSignal: ro?.abortSignal, isTransient }))\n }) as GeneratedChats['send'],\n }\n return new Proxy(gen, {\n get(target, key) {\n if (key in extra) return (extra as unknown as Record<PropertyKey, unknown>)[key]\n const v = Reflect.get(target, key, target) as unknown\n return typeof v === 'function' ? (v as (...a: unknown[]) => unknown).bind(target) : v\n },\n }) as GeneratedChats & ChatsLive\n}\n\n/** O erro tipado do REST: `apiErrorBody(e)?.code` (um `ErrorCode` do \u00A76) diz o que tratar na tela. */\nexport { SmoothAgentApiError, SmoothAgentApiTimeoutError }\nexport { apiErrorBody, type ApiErrorBody } from '../../core-live/src/rest'\nexport type { ErrorCode } from '../../core-live/src/types'\nexport type { ContractChatState, ContractItem }\nexport { ProviderSet, sortProviders, type ConnectFlow, type ConnectState, type ConnectStatus, type ProviderEntry, type ProviderGroup, type ProviderRow, type ProvidersState } from '../../core-live/src/providers'\nexport type { DebugEvent, LiveStatus, RunResult, RunEvent, WatchState, HistoryWindow, NeedsProvider, Violation } from '../../core-live/src/index'\n"],
|
|
5
|
+
"mappings": ";;;;;AAOO,IAAM,SAAS,CAClB,OACA,UACA,UACS;AACT,SAAO,KAAK,UAAU,OAAO,UAAU,KAAK;AAChD;AAQO,SAAS,SACZ,MACA,SACC;AACD,SAAO,KAAK,MAAM,MAAM,OAAO;AACnC;;;ACrBO,IAAM,sBAAN,cAAkC,MAAM;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEhB,YAAY;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ,GAMG;AACC,UAAM,aAAa,EAAE,SAAS,YAAY,KAAK,CAAC,CAAC;AACjD,WAAO,eAAe,MAAM,WAAW,SAAS;AAChD,QAAI,MAAM,mBAAmB;AACzB,YAAM,kBAAkB,MAAM,KAAK,WAAW;AAAA,IAClD;AAEA,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,OAAO;AACZ,SAAK,cAAc;AACnB,QAAI,SAAS,MAAM;AACf,WAAK,QAAQ;AAAA,IACjB;AAAA,EACJ;AAAA,EAEA,IAAW,YAAgC;AACvC,UAAM,UAAU,KAAK,aAAa;AAClC,QAAI,WAAW,MAAM;AACjB,aA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,YAAY,KAAqB,MAAmD,OAA0C;AACrI,QAAM,QAAsD;AAAA,IAC1D,OAAO,CAAC,WAAW,KAAK,MAAM,MAAM;AAAA,IACpC,QAAQ,CAAC,QAAQ,SAAS,KAAK,OAAO,QAAQ,IAAI;AAAA,IAClD,QAAQ,CAAC,QAAQ,SAAS,SAAS,KAAK,OAAO,QAAQ,SAAS,IAAI;AAAA,IACpE,WAAW,CAAC,WAAW,KAAK,UAAU,MAAM;AAAA,IAC5C,UAAU,CAAC,QAAQ,QAAQ,KAAK,SAAS,QAAQ,GAAG;AAAA,IACpD,MAAO,CAAC,KAAgB,OAA+C;AACrE,YAAM,OAAO,SAAS,GAA2E;AACjG,YAAM,cAAc,CAAC,MAAe,UAAU,GAAG,EAAE,KAAK,qBAAqB,SAAS,2BAA2B,CAAC;AAClH,aAAO,oBAAoB,YAAY,YAAY,MAAM,IAAI,KAAK,MAAM,EAAE,EAAE,gBAAgB,GAAG,EAAE,OAAO,aAAa,IAAI,aAAa,YAAY,CAAC,CAAC;AAAA,IACtJ;AAAA,EACF;AACA,SAAO,IAAI,MAAM,KAAK;AAAA,IACpB,IAAI,QAAQ,KAAK;AACf,UAAI,OAAO,MAAO,QAAQ,MAAkD,GAAG;AAC/E,YAAM,IAAI,QAAQ,IAAI,QAAQ,KAAK,MAAM;AACzC,aAAO,OAAO,MAAM,aAAc,EAAmC,KAAK,MAAM,IAAI;AAAA,IACtF;AAAA,EACF,CAAC;AACH;",
|
|
6
|
+
"names": ["SendMessage", "ChatsSendResponse", "Agent", "Queue", "BoxFileContent", "BoxFileEntry", "Chat", "ChatDeleted", "ChatSelection", "Current", "ChatTask", "EventsApprovalOption", "EventsCapabilities", "EventsDelta", "EventsEChatStateData", "EventsEItemRetractedData", "EventsENoticeData", "EventsERunCompletedData", "EventsERunStartedData", "EventsERunWaitingData", "EventsESessionStartedData", "EventsHandoffInjected", "EventsHandoffLost", "EventsInboxEntry", "EventsInboxState", "Held", "EventsItemApproval", "Action", "EventsItemCommand", "EventsItemCompaction", "EventsItemError", "EventsItemFileChange", "Changes", "Item", "EventsItemFileSearch", "EventsItemHandoff", "EventsItemHook", "EventsItemNotification", "Source", "EventsItemPlan", "Steps", "Item", "EventsItemProposedPlan", "EventsItemQuestion", "EventsItemReasoning", "EventsItemSubagent", "EventsItemText", "EventsItemTimer", "EventsItemToolCall", "EventsItemUserMessage", "EventsItemWebSearch", "EventsLimits", "EventsLimitWindow", "EventsOrigin", "EventsRawFrame", "EventsRunAgent", "EventsRunTrigger", "EventsTask", "FileObject", "LoginStatus", "Machine", "MyProviderStatus", "Via", "Connect", "Pairing", "Placement", "PreTurnHook", "Principal", "ProviderLimits", "ProviderStatus", "Via", "Connect", "RunSummary", "SwitchResult", "ToolPrincipal", "Tools", "Headers", "Headers", "Headers", "isStreamLike", "isReadableStream", "isBuffer", "isArrayBufferView", "self", "BearerAuthProvider", "request", "request", "request", "logging", "call", "ptr", "call", "call"]
|
|
7
|
+
}
|