@smoothcodes/agent-client 0.2.2 → 0.2.3

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/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  SmoothAgentApiTimeoutError,
7
7
  apiErrorBody,
8
8
  sortProviders
9
- } from "./chunk-E4ZFXITU.js";
9
+ } from "./chunk-ERJ5SQDU.js";
10
10
  import "./chunk-PZ5AY32C.js";
11
11
  export {
12
12
  DEFAULT_BASE_URL,
package/dist/testing.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SmoothAgent
3
- } from "./chunk-E4ZFXITU.js";
3
+ } from "./chunk-ERJ5SQDU.js";
4
4
  import "./chunk-PZ5AY32C.js";
5
5
 
6
6
  // src/testing.ts
@@ -29,6 +29,12 @@ export declare class FilesClient {
29
29
  * @throws {@link SmoothAgentApi.ServiceUnavailableError}
30
30
  * @throws {@link errors.SmoothAgentApiError}
31
31
  * @throws {@link errors.SmoothAgentApiTimeoutError}
32
+ *
33
+ * @example
34
+ * import { createReadStream } from "fs";
35
+ * await client.files.upload({
36
+ * file: fs.createReadStream("/path/to/your/file")
37
+ * })
32
38
  */
33
39
  upload(request: SmoothAgentApi.FilesUploadRequest, requestOptions?: FilesClient.RequestOptions): core.HttpResponsePromise<SmoothAgentApi.FileObject>;
34
40
  private __upload;
@@ -1,7 +1,14 @@
1
+ import type * as core from "../../../../../core/index.js";
2
+ /**
3
+ * @example
4
+ * {
5
+ * file: fs.createReadStream("/path/to/your/file")
6
+ * }
7
+ */
1
8
  export interface FilesUploadRequest {
2
9
  "SmoothAgent-Workspace"?: string;
3
10
  "SmoothAgent-As-User"?: string;
4
11
  /** 24 h por credencial. Mesma chave + mesmo corpo → a mesma resposta (`Idempotent-Replayed: true`); corpo diferente → `conflict`. */
5
12
  "Idempotency-Key"?: string;
6
- file?: unknown;
13
+ file: core.file.Uploadable;
7
14
  }
@@ -39,7 +39,8 @@ export declare class MachinesClient {
39
39
  list(request?: SmoothAgentApi.MachinesListRequest, requestOptions?: MachinesClient.RequestOptions): Promise<core.Page<SmoothAgentApi.Machine, SmoothAgentApi.MachinesListResponse>>;
40
40
  /**
41
41
  * Gera o código de pareamento de um computador. Chave (pra um `userId`) OU o próprio usuário
42
- * na interface do cliente (o login é do cliente, nunca nosso).
42
+ * na interface do cliente (o login é do cliente, nunca nosso). Por CHAVE (pura ou agindo como o usuário) o
43
+ * pareamento emite token pro usuário: exige `tokens:write` e o recorte de agentes da chave (`agents_restricted`).
43
44
  *
44
45
  * @param {SmoothAgentApi.MachinesPairRequest} request
45
46
  * @param {MachinesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -2,7 +2,7 @@ import type * as SmoothAgentApi from "../index.js";
2
2
  export interface Pairing {
3
3
  /** Código curto pra digitar (`XXXX-XXXX`, estilo device flow RFC 8628). */
4
4
  code: string;
5
- /** Comando pronto: `npx smoothagent connect --code XXXX-XXXX`. */
5
+ /** Comando pronto: `npx smoothagent@3 connect --code XXXX-XXXX` (fixa a major do runner). */
6
6
  command: string;
7
7
  expiresAt: SmoothAgentApi.Timestamp;
8
8
  status: Pairing.Status;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smoothcodes/agent-client",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "description": "SmoothAgent SDK do usuário (token do usuário): REST gerada do contrato + a camada ao vivo (watch, events, prompt, lista de chats). Roda no navegador e no Node.",
6
6
  "license": "UNLICENSED",