@nouter/platform 0.3.0 → 0.5.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.
@@ -3,11 +3,15 @@ type RequestOptions = Anthropic.RequestOptions;
3
3
  import type { operations } from "../generated/openapi.js";
4
4
  import type { JsonContent } from "./types.js";
5
5
  type ConsumptionQuery = NonNullable<NonNullable<operations["getV1OmaUsageLimitsConsumption"]["parameters"]>["query"]>;
6
+ type NoticesQuery = NonNullable<NonNullable<operations["getV1OmaUsageLimitsNotices"]["parameters"]>["query"]>;
6
7
  /** Un nivel de consumo; la ruta acepta más de uno, pero el transporte serializa los arrays con corchetes (`kind[]`). */
7
8
  export type PlatformConsumptionKind = Exclude<NonNullable<ConsumptionQuery["kind"]>, readonly unknown[]>;
9
+ /** NOUTER PATCH (avisos de tope, tarea 5): un nivel de aviso; los ocho del contrato de `notices`. */
10
+ export type PlatformUsageNoticeKind = Exclude<NonNullable<NoticesQuery["kind"]>, readonly unknown[]>;
8
11
  export type PlatformUsageLimits = JsonContent<operations["getV1OmaUsageLimits"]["responses"][200]>;
9
12
  export type PlatformUsageLimitsUpdate = JsonContent<NonNullable<operations["postV1OmaUsageLimits"]["requestBody"]>>;
10
13
  export type PlatformUsageConsumption = JsonContent<operations["getV1OmaUsageLimitsConsumption"]["responses"][200]>;
14
+ export type PlatformUsageNotices = JsonContent<operations["getV1OmaUsageLimitsNotices"]["responses"][200]>;
11
15
  export interface PlatformUsageLimitsParams {
12
16
  /** Sin `agent_id`, los topes de la organización. */
13
17
  agent_id?: string;
@@ -20,6 +24,23 @@ export interface PlatformUsageConsumptionParams {
20
24
  limit?: number;
21
25
  page?: string;
22
26
  }
27
+ /** NOUTER PATCH (avisos de tope, tarea 5): los filtros de `GET /v1/oma/usage_limits/notices`. */
28
+ export interface PlatformUsageNoticesParams {
29
+ kind?: PlatformUsageNoticeKind;
30
+ subject_id?: string;
31
+ threshold?: 80 | 100;
32
+ period?: string;
33
+ since?: string;
34
+ /**
35
+ * Toda la organización: solo una cookie de owner o admin, o una clave de organización; no se combina con
36
+ * `workspace_id`.
37
+ */
38
+ scope?: "organization";
39
+ /** Solo con una cookie de owner o admin: elige otro workspace; una clave no lo mueve. */
40
+ workspace_id?: string;
41
+ limit?: number;
42
+ page?: string;
43
+ }
23
44
  /**
24
45
  * `GET`/`POST /v1/oma/usage_limits` (los topes de la organización o de un agente) y la lectura del consumo con sus
25
46
  * páginas. La familia de error es `v1`.
@@ -30,5 +51,7 @@ export declare class UsageLimitsResource {
30
51
  get(params?: PlatformUsageLimitsParams, options?: RequestOptions): Promise<PlatformUsageLimits>;
31
52
  set(params: PlatformUsageLimitsUpdate, options?: RequestOptions): Promise<PlatformUsageLimits>;
32
53
  consumption(params?: PlatformUsageConsumptionParams, options?: RequestOptions): Promise<PlatformUsageConsumption>;
54
+ /** NOUTER PATCH (avisos de tope, tarea 5): los avisos 80/100 registrados, en `sent_at` descendente. */
55
+ notices(params?: PlatformUsageNoticesParams, options?: RequestOptions): Promise<PlatformUsageNotices>;
33
56
  }
34
57
  export {};
@@ -35,4 +35,23 @@ export class UsageLimitsResource {
35
35
  },
36
36
  });
37
37
  }
38
+ /** NOUTER PATCH (avisos de tope, tarea 5): los avisos 80/100 registrados, en `sent_at` descendente. */
39
+ notices(params = {}, options) {
40
+ return platformRequest(this.client, "get", "/v1/oma/usage_limits/notices", {
41
+ ...options,
42
+ query: {
43
+ ...(params.kind !== undefined && { kind: params.kind }),
44
+ ...(params.subject_id !== undefined && { subject_id: params.subject_id }),
45
+ ...(params.threshold !== undefined && { threshold: params.threshold }),
46
+ ...(params.period !== undefined && { period: params.period }),
47
+ ...(params.since !== undefined && { since: params.since }),
48
+ ...(params.scope !== undefined && { scope: params.scope }),
49
+ ...(params.workspace_id !== undefined && {
50
+ workspace_id: params.workspace_id,
51
+ }),
52
+ ...(params.limit !== undefined && { limit: params.limit }),
53
+ ...(params.page !== undefined && { page: params.page }),
54
+ },
55
+ });
56
+ }
38
57
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const PLATFORM_SDK_VERSION = "0.3.0";
1
+ export declare const PLATFORM_SDK_VERSION = "0.5.0";
package/dist/version.js CHANGED
@@ -2,4 +2,4 @@
2
2
  // (https://github.com/anthropics/anthropic-sdk-typescript/blob/main/src/version.ts, `export const VERSION = '…'`). Se
3
3
  // mantiene acá y no leyendo `package.json` para no meter `node:fs` en un paquete que hoy no depende de ningún builtin.
4
4
  // `test/user-agent.test.ts` falla si esta constante se separa del manifiesto.
5
- export const PLATFORM_SDK_VERSION = "0.3.0";
5
+ export const PLATFORM_SDK_VERSION = "0.5.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nouter/platform",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Nouter platform SDK: the official Anthropic Managed Agents client plus typed Nouter platform extensions.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",