@nouter/platform 0.4.0 → 0.6.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 ADDED
@@ -0,0 +1,169 @@
1
+ # @nouter/platform
2
+
3
+ ## 0.6.0 — 2026-12-02
4
+
5
+ ### Minor Changes
6
+
7
+ - `client.platform.skills` tipa `/v1/skills`: `list`, `create`, `versions.create` y `versions.content`, con cada archivo
8
+ bajo su ruta relativa y `anthropic-beta: skills-2025-10-02` en todas las llamadas. `content` devuelve el `Response`
9
+ crudo del zip (leer o cancelar `body`); los `POST` van con `maxRetries: 0` y el error del SDK oficial se traduce a
10
+ `PlatformApiError` (plan 2026-12-02 cli-skills-apply, tareas 1 y 2).
11
+
12
+ ### Patch Changes
13
+
14
+ - El tarball publica `CHANGELOG.md`: suma el archivo al campo `files` y al control de `npm pack --dry-run`.
15
+
16
+ ## 0.5.0 — 2026-12-02
17
+
18
+ ### Minor Changes
19
+
20
+ - Los tipos de evals cubren lo que el servidor ya acepta: `MessagesCaseInput` suma `canary`, `budget` y
21
+ `mock_script`; el benchmark `messages` y `EvalBenchmark` suman `user_profile: { per_trial: true }` (plan
22
+ 2026-11-30 de evals de la CLI, tarea 2).
23
+ - `client.platform.serviceAccounts` tipa las cuentas de servicio de `/v1/oma/service_accounts`: `list`, `create`,
24
+ `retrieve` y `archive` (plan 2026-11-29, tarea 2).
25
+ - `client.platform.federation` tipa la federación de `/v1/oma`: `federation.issuers` y `federation.rules`, cada uno con
26
+ `list`, `create`, `retrieve` y `archive` (plan 2026-11-29, tarea 3).
27
+ - `list` de `serviceAccounts`, `federation.issuers` y `federation.rules` acepta la query del contrato tipada
28
+ (`limit`, `page`, `include_archived`; en reglas también `issuer_id`); `include_archived` es booleano en el SDK y va al
29
+ wire como `"true"`/`"false"`.
30
+
31
+ ## 0.4.0 — 2026-12-01
32
+
33
+ ### Minor Changes
34
+
35
+ - `client.platform.sessions.outputs` tipa los outputs de una sesión: `list` y `content`, los dos con el
36
+ `anthropic-beta: managed-agents-2026-04-01` que la ruta exige. `content` devuelve el `Response` crudo para no
37
+ decodificar los bytes como UTF-8; hay que leer o cancelar `body`. `withBeta` ahora concatena el beta del llamador en
38
+ vez de pisarlo (plan 2026-11-29, tarea 1).
39
+ - `usageLimits.notices` acepta `scope: "organization"`: la lectura de toda la organización, con una cookie de owner o
40
+ admin o una clave de organización (plan 2026-12-01, tarea 2).
41
+ - `SessionListParams` tipa `user_profile_id`, `created_by` y `q`: la ruta `GET /v1/sessions` ya los acepta y el SDK
42
+ oficial ya los manda con el resto de las claves. Es una brecha solo de tipos (plan 2026-11-30, tarea 1).
43
+ - La respuesta de Dreams documenta `usage.cache_write_details`, el desglose de las escrituras de caché por TTL
44
+ (`ttl_5m_input_tokens`, `ttl_1h_input_tokens`, `ttl_30m_input_tokens` y `ttl_12h_input_tokens`, opcionales).
45
+
46
+ ### Patch Changes
47
+
48
+ - Sin cambios de código: el login de la CLI autentica la sesión con el `authToken` (Bearer) que el SDK ya expone. La
49
+ 0.4.0 en lockstep con `@nouter/platform-cli` llega en el PR de release.
50
+
51
+ ## 0.3.0 — 2026-11-29
52
+
53
+ ### Minor Changes
54
+
55
+ - `engines.node` pasa a `>=20.6`, igual que la CLI, que sale en lockstep con la misma versión.
56
+
57
+ ### Patch Changes
58
+
59
+ - El cliente manda por default `User-Agent: nouter-platform-sdk/<versión>`; si el integrador pasa el suyo, el del SDK
60
+ se suma al final (`<el suyo> nouter-platform-sdk/<versión>`) en vez de reemplazarlo.
61
+ - `repository.url` con `git+https://`, como lo normaliza npm al publicar (`npm pkg fix`).
62
+
63
+ ## 0.2.0 — 2026-11-29
64
+
65
+ ### Minor Changes
66
+
67
+ - Las claves con alcance, vencimiento y agente de D-5 en `client.platform.apiKeys` (`create` con `scopes`,
68
+ `expires_at` y `agent_id`, `list`, `update`, `disable`, `enable`, `revoke` y `rotate`), con `KEY_PRESETS` para los
69
+ presets `backend` y `ci`.
70
+ - La auditoría de administración en `client.platform.auditEvents.list`, con filtros y paginación por `next_page`, y
71
+ `client.platform.me` con el rol y los alcances efectivos de D-5.
72
+
73
+ ### Patch Changes
74
+
75
+ - Los `POST` de `client.platform`, de las extensiones de `/v1/oma` (evals, modelos y `platform.request`) se mandan con
76
+ `maxRetries: 0`: ninguna de esas rutas monta `Idempotency-Key`, así que un reintento automático podía crear una clave
77
+ dos veces, rotarla dos veces o duplicar un pedido de borrado. Los `GET` siguen reintentando; el llamador puede pedir
78
+ reintentos explícitos con `maxRetries` en las opciones.
79
+ - `client.beta` conserva los reintentos oficiales, también en `POST`: el SDK fijado (1.13.0) no tiene
80
+ `idempotencyHeader` y marca `idempotencyKey` sin efecto, así que no se manda `Idempotency-Key` y un reintento de
81
+ `sessions.create`, `deployments.run`, `agents.create` o `environments.create` puede duplicar.
82
+ - `PlatformApiError.errorCode` también llega en los errores de la familia de texto de `/v1/oma`
83
+ (`{ error, error_code?, request_id }`): antes de este cambio quedaba `null` aunque el cuerpo trajera el código
84
+ (los `403` de la guarda, de la cookie y de miembros e invitaciones).
85
+ - Bump `@anthropic-ai/sdk` from 1.3.0 to 1.13.0, pinned (Devtools task 3a, #408).
86
+
87
+ ## 1.2.0
88
+
89
+ ### Minor Changes
90
+
91
+ - 957e1da: Add eval support (benchmarks → cases → eval runs, Harbor and messages kinds): `client.oma.evals` in the SDK (`benchmarks` list/listBuiltin/create/retrieve/update/delete/upload, `benchmarks.cases` retrieve/add/replace/delete, `runs` create/list/retrieve/cancel/delete/waitForRun) and `oma evals benchmarks …` / `oma evals cases …` / `oma evals run` / `oma evals runs …` in the CLI.
92
+
93
+ Harbor benchmarks are read-only imports with immutable revisions: new `git` source (github.com / huggingface.co), `benchmarks.sync`/`syncUpload`, `evals.gitRefs({ url })` (branches and tags to pick a ref) and `{ revision }` on benchmark/case retrieve in the SDK; `oma evals benchmarks import --git <url> [--ref] [--path]`, `oma evals benchmarks sync <id> [--ref|--file]` and `--revision N` on benchmark/case show in the CLI. Harbor case add/replace/delete helpers and empty harbor benchmarks are removed.
94
+
95
+ ## 1.1.2
96
+
97
+ ### Patch Changes
98
+
99
+ - 4fa0828: Bump @anthropic-ai/sdk from 0.120.0 to 1.3.0 and adapt types for the 1.x / API 2026-10-21 breaking changes (including CLI skills list display_name / source.type).
100
+
101
+ ## 1.1.1
102
+
103
+ ### Patch Changes
104
+
105
+ - 1321265: Point CLI and SDK hosted defaults at live `openma.ai` hosts (`https://app.openma.ai` for Console/API; marketing homepage `https://openma.ai`). `OMA_BASE_URL` / `baseURL` overrides still win.
106
+
107
+ ## 1.1.0
108
+
109
+ ### Minor Changes
110
+
111
+ - 1599e16: Support the `multiagent_20261001` agent configuration (predefined and inline subagents with pinned versions), paginate agent lists, and list the deployment harness catalog through `oma.harnesses`.
112
+
113
+ ### Patch Changes
114
+
115
+ - 30f388d: Document how deferred MCP tools are called when the model cannot declare tools mid-conversation: the tool list stays fixed and found tools are called through `mcp_invoke`. Document `tool_search_deferred_hints`, whose default now follows that mode.
116
+
117
+ ## 1.0.2
118
+
119
+ ### Patch Changes
120
+
121
+ - 57906b3: Pi harness skill mounting strategies (`skill_mount`: `progressive` default, `budgeted`, `tool`, `inline`) replace default full SKILL.md system-prompt inlining for default/Pi harnesses. Deferred skills in `budgeted` mode are discoverable via `tool_search`; `tool` mode adds a `skill` loader tool.
122
+
123
+ ## 1.0.1
124
+
125
+ ### Patch Changes
126
+
127
+ - 38f58cb: Pi agent-core is the default harness; legacy `ai-sdk` remains available but deprecated (one-time `session.warning` per session). Agents accept compaction via `_oma.context_management` (Anthropic Messages shape) or `_oma.model_settings` (OpenAI Agents SDK shape); conflicting dual definitions are rejected at save time. MCP tool results preserve content blocks on the wire. Agent `max_tokens` above the catalog window is accepted with a warning; pi-ai clamps output per request.
128
+ - 2f7c08d: Document agent metadata for deferred MCP `tool_search`: `tool_search` (`auto` | `on` | `off`, default `auto`), optional `tool_search_limit`, `tool_search_auto_threshold`, and `tool_search_always_load`. Backward compatible — omitting `tool_search` keeps automatic exposure when MCP tool definitions exceed a fraction of the model context window.
129
+
130
+ ## 1.0.0
131
+
132
+ ### Major Changes
133
+
134
+ - 68d2772: Replace the independent Managed Agents client with a composition facade over
135
+ `@anthropic-ai/sdk`, and isolate OpenMA product extensions under `client.oma`.
136
+
137
+ ### Patch Changes
138
+
139
+ - 7629a91: Expose typed Model Card management and Pi provider metadata through the SDK,
140
+ align model catalog discovery across Node and Cloudflare, and document the
141
+ runtime semantics of effort, speed, and custom Pi model configuration.
142
+ - 952fc3f: Add strongly typed `_oma` Agent extensions and the standard sandbox `stdio` MCP transport to create/update payloads while preserving the official Anthropic Managed Agents resource tree.
143
+
144
+ ## 1.0.0-beta.2
145
+
146
+ ### Patch Changes
147
+
148
+ - 952fc3f: Add strongly typed `_oma` Agent extensions and the standard sandbox `stdio` MCP transport to create/update payloads while preserving the official Anthropic Managed Agents resource tree.
149
+
150
+ ## 1.0.0-beta.1
151
+
152
+ ### Patch Changes
153
+
154
+ - 7629a91: Expose typed Model Card management and Pi provider metadata through the SDK,
155
+ align model catalog discovery across Node and Cloudflare, and document the
156
+ runtime semantics of effort, speed, and custom Pi model configuration.
157
+
158
+ ## 1.0.0-beta.0
159
+
160
+ ### Major Changes
161
+
162
+ - 68d2772: Replace the independent Managed Agents client with a composition facade over
163
+ `@anthropic-ai/sdk`, and isolate OpenMA product extensions under `client.oma`.
164
+
165
+ ## 0.1.0
166
+
167
+ ### Minor Changes
168
+
169
+ - f72a33f: Add a dreams resource with automatic Managed Agents dreaming beta headers.
package/README.md CHANGED
@@ -117,10 +117,28 @@ await client.platform.apiKeys.rotate(key.id, { grace_period_seconds: 0 });
117
117
  await client.platform.apiKeys.disable(key.id);
118
118
  await client.platform.auditEvents.list({ action: "api_key.rotated" });
119
119
  const me = await client.platform.me.get(); // role and effective scopes
120
+
121
+ // Skills of the workspace (beta skills-2025-10-02): list, create and a new version.
122
+ // Each file travels with its relative path as the multipart filename; display_name is
123
+ // derived from the SKILL.md frontmatter server-side, so the upload never sends it.
124
+ const skills = await client.platform.skills.list({ source: "custom", limit: 20 });
125
+ // SKILL.md must start with name/description frontmatter; the server rejects a package without it.
126
+ const skillMd = "---\nname: my-skill\ndescription: Summarizes weekly reports.\n---\n";
127
+ const skill = await client.platform.skills.create({
128
+ files: [{ path: "SKILL.md", content: new TextEncoder().encode(skillMd) }],
129
+ });
130
+ const version = await client.platform.skills.versions.create(skill.id, {
131
+ files: [{ path: "SKILL.md", content: new TextEncoder().encode(`${skillMd}\nKeep it short.`) }],
132
+ });
133
+ // The version content comes back as the raw Response (the zip): read or cancel its body.
134
+ const zip = await client.platform.skills.versions.content(skill.id, version.id);
135
+ const bytes = new Uint8Array(await zip.arrayBuffer());
120
136
  ```
121
137
 
122
138
  `userProfiles.*`, including `delete`, send `anthropic-beta: user-profiles-2026-08-18`;
123
- `privacyErasure.*` sends `anthropic-beta: privacy-erasure-2026-11-19`.
139
+ `privacyErasure.*` sends `anthropic-beta: privacy-erasure-2026-11-19`; `skills.*` sends
140
+ `anthropic-beta: skills-2025-10-02` on every call and its `POST`s keep `maxRetries: 0`, so a
141
+ retried upload cannot duplicate a skill.
124
142
 
125
143
  ## Errors
126
144
 
@@ -140,7 +158,7 @@ failure or timeout); those errors are `retryable: true`.
140
158
  The Managed Agents resources keep the `@anthropic-ai/sdk` error classes, and so do
141
159
  `platform.models`, `platform.harnesses`, `platform.evals` and the raw `platform.request`;
142
160
  `userProfiles`, `usage`, `usageLimits`, `rateLimits`, `settings`, `modelCards`,
143
- `privacyErasure`, `apiKeys`, `auditEvents` and `me` translate.
161
+ `privacyErasure`, `apiKeys`, `auditEvents`, `me` and `skills` translate.
144
162
 
145
163
  ```ts
146
164
  import { PlatformApiError } from "@nouter/platform";
package/dist/agents.d.ts CHANGED
@@ -239,6 +239,10 @@ export interface PlatformAgentExtensionParams {
239
239
  external_facing?: boolean;
240
240
  external_models_only?: boolean;
241
241
  policy?: PlatformAgentPolicy | null;
242
+ /** Clases declaradas de las custom tools; una sin entrada cuenta como `write`. `null` borra la declaración. */
243
+ custom_tools?: Record<string, {
244
+ class: PlatformMcpToolClass;
245
+ }> | null;
242
246
  }
243
247
  export interface PlatformAgentAcp {
244
248
  agent: {
@@ -275,6 +279,9 @@ export interface PlatformAgentExtension {
275
279
  external_facing?: boolean;
276
280
  external_models_only?: boolean;
277
281
  policy?: PlatformAgentPolicy;
282
+ custom_tools?: Record<string, {
283
+ class: PlatformMcpToolClass;
284
+ }>;
278
285
  }
279
286
  declare module "@anthropic-ai/sdk/resources/beta/agents/agents" {
280
287
  interface BetaManagedAgentsURLMCPServerParams {
package/dist/evals.d.ts CHANGED
@@ -211,6 +211,8 @@ export interface EvalGitRefList {
211
211
  truncated: boolean;
212
212
  }
213
213
  export type EvalRunStatus = "pending" | "running" | "completed" | "failed" | "cancelled";
214
+ /** Un run no queda `skipped`: el tope de costo deja así sus trials y sus tareas, y el run cierra parcial. */
215
+ export type EvalTrialStatus = EvalRunStatus | "skipped";
214
216
  export type CreateEvalRunRequest =
215
217
  /** Run a benchmark (all runnable cases, or case_names). The run's kind is
216
218
  * the benchmark's kind; a harbor run is bound to the latest revision. */
@@ -230,12 +232,28 @@ export type CreateEvalRunRequest =
230
232
  trials?: number;
231
233
  /** Trials running at once, default 4, max 32. */
232
234
  concurrency?: number;
235
+ /** Vaults to attach to every Session of the case when it has none. */
236
+ vault_ids?: string[];
237
+ /** Vaults per case, keyed by case name; wins over vault_ids for that case. */
238
+ case_vault_ids?: Record<string, string[]>;
239
+ /**
240
+ * Tope de costo de listado del run, en dólares, como decimal con hasta seis decimales; mayor que cero.
241
+ * Cada Session de trial lleva un budget igual al restante redondeado hacia arriba al centavo.
242
+ */
243
+ max_cost_usd?: string;
233
244
  }
234
245
  /** Inline messages tasks (the original API, unchanged). */
235
246
  | {
236
247
  kind?: "messages";
237
248
  agent_id: string;
238
249
  environment_id: string;
250
+ /** Vaults to attach to every Session of the task when it has none. */
251
+ vault_ids?: string[];
252
+ /**
253
+ * Tope de costo de listado del run, en dólares, como decimal con hasta seis decimales; mayor que cero.
254
+ * Cada Session de trial lleva un budget igual al restante redondeado hacia arriba al centavo.
255
+ */
256
+ max_cost_usd?: string;
239
257
  tasks: Array<{
240
258
  id: string;
241
259
  messages: string[];
@@ -246,6 +264,8 @@ export type CreateEvalRunRequest =
246
264
  setup_script?: string;
247
265
  timeout_ms?: number;
248
266
  trials?: number;
267
+ /** Vaults of this task's Sessions; [] means none. */
268
+ vault_ids?: string[];
249
269
  /** eval-core RewardSpec; type must be verifiable | script | reward_model | composite (else 400). */
250
270
  reward?: unknown;
251
271
  }>;
@@ -257,7 +277,7 @@ export interface CreateEvalRunResponse {
257
277
  export type EvalTrialPhase = "provisioning" | "agent" | "verifying" | "done";
258
278
  export interface EvalTrial {
259
279
  trial_index: number;
260
- status: EvalRunStatus;
280
+ status: EvalTrialStatus;
261
281
  phase?: EvalTrialPhase;
262
282
  session_id?: string;
263
283
  started_at?: string;
@@ -279,7 +299,7 @@ export interface EvalTrial {
279
299
  export interface EvalRunTask {
280
300
  /** Case name (benchmark runs) or inline task id. */
281
301
  id: string;
282
- status: EvalRunStatus;
302
+ status: EvalTrialStatus;
283
303
  trials: EvalTrial[];
284
304
  trial_total: number;
285
305
  trial_pass_count?: number;
@@ -312,6 +332,19 @@ export interface EvalRun {
312
332
  /** Mean of per-task mean_reward over tasks with at least one graded trial. */
313
333
  score?: number;
314
334
  concurrency?: number;
335
+ /**
336
+ * Tope de costo de listado del run, en dólares, tal como se mandó. Solo con tope. Cada Session de trial lleva un
337
+ * budget igual al restante del run al arrancarla, redondeado hacia arriba al centavo.
338
+ */
339
+ max_cost_usd?: string;
340
+ /** Suma de `usage.list_cost` leída, en centavos; un piso del gasto, no la factura. Solo con tope. */
341
+ list_cost?: string;
342
+ /** true cuando el tope de costo dejó trials sin arrancar; el run igual queda `completed`. */
343
+ partial: boolean;
344
+ /** Motivo del parcial; hoy solo el tope de costo. */
345
+ partial_reason?: "cost_ceiling" | "cost_unavailable";
346
+ /** Tareas con todos sus trials salteados por el tope (`status: "skipped"`). */
347
+ skipped_count: number;
315
348
  tasks: EvalRunTask[];
316
349
  error?: string;
317
350
  }