@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.
- package/README.md +17 -0
- package/dist/agents.d.ts +19 -0
- package/dist/evals.d.ts +16 -0
- package/dist/evals.js +36 -38
- package/dist/generated/openapi.d.ts +6091 -2842
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/oma.d.ts +9 -0
- package/dist/oma.js +12 -0
- package/dist/platform/api-keys.js +5 -1
- package/dist/platform/federation.d.ts +120 -0
- package/dist/platform/federation.js +100 -0
- package/dist/platform/http.d.ts +21 -1
- package/dist/platform/http.js +43 -5
- package/dist/platform/service-accounts.d.ts +61 -0
- package/dist/platform/service-accounts.js +47 -0
- package/dist/platform/sessions.d.ts +33 -0
- package/dist/platform/sessions.js +59 -0
- package/dist/platform/usage-limits.d.ts +23 -0
- package/dist/platform/usage-limits.js +19 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -97,6 +97,7 @@ const csv = await client.platform.usage.export({ days: "30" });
|
|
|
97
97
|
|
|
98
98
|
await client.platform.usageLimits.get({ agent_id: "agent_..." });
|
|
99
99
|
await client.platform.usageLimits.consumption({ page: "..." });
|
|
100
|
+
await client.platform.usageLimits.notices({ kind: "person_day", threshold: 80 });
|
|
100
101
|
const limits = await client.platform.rateLimits.list();
|
|
101
102
|
await client.platform.settings.set({ org_day_limit_micros: "30000000" });
|
|
102
103
|
|
|
@@ -179,6 +180,22 @@ const stats = await client.platform.request<{ agents: number }>({
|
|
|
179
180
|
});
|
|
180
181
|
```
|
|
181
182
|
|
|
183
|
+
## Feedback
|
|
184
|
+
|
|
185
|
+
Report product bugs, feature requests and questions at
|
|
186
|
+
https://github.com/Nouter-ai/feedback. Use the "Bug report / Error", "Feature
|
|
187
|
+
request / Funcionalidad" or "Question / Pregunta" form. In the "Product /
|
|
188
|
+
Producto" field, "This feedback channel / Este canal de feedback" is for
|
|
189
|
+
feedback about the channel itself.
|
|
190
|
+
Only bugs and features of Nouter products.
|
|
191
|
+
What a single customer needs belongs to that customer's implementation, not to
|
|
192
|
+
an issue. Never include customer data. Agents: read
|
|
193
|
+
https://github.com/Nouter-ai/feedback/blob/main/AGENTS.md before opening one.
|
|
194
|
+
Security issues go through the repository's private vulnerability reporting.
|
|
195
|
+
If your GitHub account is an Enterprise Managed User (EMU), follow the
|
|
196
|
+
repository's README for now; the nouter-platform feedback command (feedback#56)
|
|
197
|
+
will be the route later.
|
|
198
|
+
|
|
182
199
|
## License
|
|
183
200
|
|
|
184
201
|
Apache-2.0. See `LICENSE` and `NOTICE`.
|
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 {
|
|
@@ -320,6 +327,18 @@ declare module "@anthropic-ai/sdk/resources/beta/sessions/sessions" {
|
|
|
320
327
|
/** El perfil de persona que abre la sesión (2a). */
|
|
321
328
|
user_profile_id?: string;
|
|
322
329
|
}
|
|
330
|
+
/**
|
|
331
|
+
* `GET /v1/sessions` ya acepta estos tres filtros y el SDK oficial manda cualquier clave extra: es una brecha solo
|
|
332
|
+
* de tipos. Declararlos evita el cast en la CLI y sirve a cualquier integrador.
|
|
333
|
+
*/
|
|
334
|
+
interface SessionListParams {
|
|
335
|
+
/** La persona que abrió la sesión. */
|
|
336
|
+
user_profile_id?: string;
|
|
337
|
+
/** Quién la creó, como id del snapshot. */
|
|
338
|
+
created_by?: string;
|
|
339
|
+
/** Búsqueda por texto sobre la sesión. */
|
|
340
|
+
q?: string;
|
|
341
|
+
}
|
|
323
342
|
interface BetaManagedAgentsSession {
|
|
324
343
|
user_profile_id?: string | null;
|
|
325
344
|
}
|
package/dist/evals.d.ts
CHANGED
|
@@ -70,6 +70,14 @@ export interface MessagesCaseInput {
|
|
|
70
70
|
/** Bash run in the Session sandbox before the first message. */
|
|
71
71
|
setup_script?: string;
|
|
72
72
|
timeout_ms?: number;
|
|
73
|
+
/** Marca opaca y única del caso, para el cruce de canarios entre casos. */
|
|
74
|
+
canary?: string;
|
|
75
|
+
/** Tope de costo de listado de la conversación, en centavos y como string. */
|
|
76
|
+
budget?: {
|
|
77
|
+
max_list_cost: string;
|
|
78
|
+
};
|
|
79
|
+
/** Guion del modelo falso (NOUTER_E2E_*); el modelo real nunca lo ve. */
|
|
80
|
+
mock_script?: string;
|
|
73
81
|
}
|
|
74
82
|
export type CreateEvalBenchmarkRequest =
|
|
75
83
|
/** Import a harbor benchmark (revision 1). name defaults to the source's
|
|
@@ -86,6 +94,10 @@ export type CreateEvalBenchmarkRequest =
|
|
|
86
94
|
name: string;
|
|
87
95
|
source?: undefined;
|
|
88
96
|
cases?: MessagesCaseInput[];
|
|
97
|
+
/** Una persona sintética por trial, creada y archivada por el runner. */
|
|
98
|
+
user_profile?: {
|
|
99
|
+
per_trial: true;
|
|
100
|
+
};
|
|
89
101
|
};
|
|
90
102
|
export interface UpdateEvalBenchmarkRequest {
|
|
91
103
|
name?: string;
|
|
@@ -166,6 +178,10 @@ export interface EvalBenchmark {
|
|
|
166
178
|
updated_at: string;
|
|
167
179
|
/** present on GET /benchmarks/:id and write responses */
|
|
168
180
|
cases?: EvalCase[];
|
|
181
|
+
/** messages: una persona sintética por trial (la crea y la archiva el runner). */
|
|
182
|
+
user_profile?: {
|
|
183
|
+
per_trial: true;
|
|
184
|
+
};
|
|
169
185
|
/** harbor, on GET /benchmarks/:id and write responses: newest first. */
|
|
170
186
|
revisions?: EvalBenchmarkRevision[];
|
|
171
187
|
/** Revision the listed cases belong to (harbor, with cases). */
|
package/dist/evals.js
CHANGED
|
@@ -1,27 +1,7 @@
|
|
|
1
1
|
import Anthropic, { toFile } from "@anthropic-ai/sdk";
|
|
2
|
-
import { withRetryPolicy } from "./platform/http.js";
|
|
2
|
+
import { MANAGED_AGENTS_BETA, withBeta, withRetryPolicy } from "./platform/http.js";
|
|
3
3
|
export const EVAL_RUN_TERMINAL_STATUSES = ["completed", "failed", "cancelled"];
|
|
4
|
-
const MANAGED_AGENTS_BETA = "managed-agents-2026-04-01";
|
|
5
4
|
const ARCHIVE_NAME = /\.(tar|tar\.gz|tgz)$/i;
|
|
6
|
-
/** Add the Managed Agents beta header unless the caller already set one. */
|
|
7
|
-
function withBeta(options) {
|
|
8
|
-
const headers = options?.headers;
|
|
9
|
-
if (headers == null)
|
|
10
|
-
return { ...options, headers: { "anthropic-beta": MANAGED_AGENTS_BETA } };
|
|
11
|
-
if (headers instanceof Headers) {
|
|
12
|
-
const merged = new Headers(headers);
|
|
13
|
-
if (!merged.has("anthropic-beta"))
|
|
14
|
-
merged.set("anthropic-beta", MANAGED_AGENTS_BETA);
|
|
15
|
-
return { ...options, headers: merged };
|
|
16
|
-
}
|
|
17
|
-
if (Array.isArray(headers)) {
|
|
18
|
-
const has = headers.some((h) => String(h[0]).toLowerCase() === "anthropic-beta");
|
|
19
|
-
return { ...options, headers: has ? headers : [["anthropic-beta", MANAGED_AGENTS_BETA], ...headers] };
|
|
20
|
-
}
|
|
21
|
-
const record = headers;
|
|
22
|
-
const has = Object.keys(record).some((k) => k.toLowerCase() === "anthropic-beta");
|
|
23
|
-
return { ...options, headers: has ? headers : { "anthropic-beta": MANAGED_AGENTS_BETA, ...record } };
|
|
24
|
-
}
|
|
25
5
|
function enc(id) {
|
|
26
6
|
if (typeof id !== "string" || id.length === 0)
|
|
27
7
|
throw new TypeError("id must be a non-empty string");
|
|
@@ -65,19 +45,25 @@ export class EvalCasesResource {
|
|
|
65
45
|
}
|
|
66
46
|
/** One case; harbor benchmarks accept { revision } (default latest). */
|
|
67
47
|
retrieve(benchmarkId, name, params = {}, options) {
|
|
68
|
-
return this.client.get(this.path(benchmarkId, name), {
|
|
48
|
+
return this.client.get(this.path(benchmarkId, name), {
|
|
49
|
+
...revisionQuery(params),
|
|
50
|
+
...withBeta(MANAGED_AGENTS_BETA, options),
|
|
51
|
+
});
|
|
69
52
|
}
|
|
70
53
|
/** messages benchmarks only (harbor cases are read-only; sync the benchmark instead). */
|
|
71
54
|
add(benchmarkId, params, options) {
|
|
72
|
-
return this.client.post(this.path(benchmarkId), withRetryPolicy("post", { body: params, ...withBeta(options) }));
|
|
55
|
+
return this.client.post(this.path(benchmarkId), withRetryPolicy("post", { body: params, ...withBeta(MANAGED_AGENTS_BETA, options) }));
|
|
73
56
|
}
|
|
74
57
|
/** messages benchmarks only. */
|
|
75
58
|
replace(benchmarkId, name, params, options) {
|
|
76
|
-
return this.client.put(this.path(benchmarkId, name), {
|
|
59
|
+
return this.client.put(this.path(benchmarkId, name), {
|
|
60
|
+
body: params,
|
|
61
|
+
...withBeta(MANAGED_AGENTS_BETA, options),
|
|
62
|
+
});
|
|
77
63
|
}
|
|
78
64
|
/** messages benchmarks only. */
|
|
79
65
|
delete(benchmarkId, name, options) {
|
|
80
|
-
return this.client.delete(this.path(benchmarkId, name), withBeta(options));
|
|
66
|
+
return this.client.delete(this.path(benchmarkId, name), withBeta(MANAGED_AGENTS_BETA, options));
|
|
81
67
|
}
|
|
82
68
|
}
|
|
83
69
|
export class EvalBenchmarksResource {
|
|
@@ -88,23 +74,26 @@ export class EvalBenchmarksResource {
|
|
|
88
74
|
this.cases = new EvalCasesResource(client);
|
|
89
75
|
}
|
|
90
76
|
list(options) {
|
|
91
|
-
return this.client.get("/v1/oma/evals/benchmarks", withBeta(options));
|
|
77
|
+
return this.client.get("/v1/oma/evals/benchmarks", withBeta(MANAGED_AGENTS_BETA, options));
|
|
92
78
|
}
|
|
93
79
|
listBuiltin(options) {
|
|
94
|
-
return this.client.get("/v1/oma/evals/benchmarks/builtin", withBeta(options));
|
|
80
|
+
return this.client.get("/v1/oma/evals/benchmarks/builtin", withBeta(MANAGED_AGENTS_BETA, options));
|
|
95
81
|
}
|
|
96
82
|
/** Import a harbor benchmark from a source (revision 1), or create a messages benchmark. */
|
|
97
83
|
create(params, options) {
|
|
98
|
-
return this.client.post("/v1/oma/evals/benchmarks", withRetryPolicy("post", { body: params, ...withBeta(options) }));
|
|
84
|
+
return this.client.post("/v1/oma/evals/benchmarks", withRetryPolicy("post", { body: params, ...withBeta(MANAGED_AGENTS_BETA, options) }));
|
|
99
85
|
}
|
|
100
86
|
/** With cases (of { revision }, default latest) and, for harbor, its revisions. */
|
|
101
87
|
retrieve(id, params = {}, options) {
|
|
102
|
-
return this.client.get(`/v1/oma/evals/benchmarks/${enc(id)}`, {
|
|
88
|
+
return this.client.get(`/v1/oma/evals/benchmarks/${enc(id)}`, {
|
|
89
|
+
...revisionQuery(params),
|
|
90
|
+
...withBeta(MANAGED_AGENTS_BETA, options),
|
|
91
|
+
});
|
|
103
92
|
}
|
|
104
93
|
/** harbor: re-read the source; a new revision is made only when content changed.
|
|
105
94
|
* git sources accept { ref }; upload sources need { file_id } (see syncUpload). */
|
|
106
95
|
sync(id, params = {}, options) {
|
|
107
|
-
return this.client.post(`/v1/oma/evals/benchmarks/${enc(id)}/sync`, withRetryPolicy("post", { body: params, ...withBeta(options) }));
|
|
96
|
+
return this.client.post(`/v1/oma/evals/benchmarks/${enc(id)}/sync`, withRetryPolicy("post", { body: params, ...withBeta(MANAGED_AGENTS_BETA, options) }));
|
|
108
97
|
}
|
|
109
98
|
/** harbor upload benchmark: upload a new .tar/.tar.gz through the Files API, then sync from it. */
|
|
110
99
|
async syncUpload(id, params, options) {
|
|
@@ -113,10 +102,13 @@ export class EvalBenchmarksResource {
|
|
|
113
102
|
return this.sync(id, { file_id: fileId }, options);
|
|
114
103
|
}
|
|
115
104
|
update(id, params, options) {
|
|
116
|
-
return this.client.patch(`/v1/oma/evals/benchmarks/${enc(id)}`, {
|
|
105
|
+
return this.client.patch(`/v1/oma/evals/benchmarks/${enc(id)}`, {
|
|
106
|
+
body: params,
|
|
107
|
+
...withBeta(MANAGED_AGENTS_BETA, options),
|
|
108
|
+
});
|
|
117
109
|
}
|
|
118
110
|
delete(id, options) {
|
|
119
|
-
return this.client.delete(`/v1/oma/evals/benchmarks/${enc(id)}`, withBeta(options));
|
|
111
|
+
return this.client.delete(`/v1/oma/evals/benchmarks/${enc(id)}`, withBeta(MANAGED_AGENTS_BETA, options));
|
|
120
112
|
}
|
|
121
113
|
/** Upload a .tar/.tar.gz through the Files API, then import it as a harbor benchmark. */
|
|
122
114
|
async upload(params, options) {
|
|
@@ -134,19 +126,22 @@ export class EvalRunsResource {
|
|
|
134
126
|
this.client = client;
|
|
135
127
|
}
|
|
136
128
|
create(params, options) {
|
|
137
|
-
return this.client.post("/v1/oma/evals/runs", withRetryPolicy("post", { body: params, ...withBeta(options) }));
|
|
129
|
+
return this.client.post("/v1/oma/evals/runs", withRetryPolicy("post", { body: params, ...withBeta(MANAGED_AGENTS_BETA, options) }));
|
|
138
130
|
}
|
|
139
131
|
list(params = {}, options) {
|
|
140
|
-
return this.client.get("/v1/oma/evals/runs", {
|
|
132
|
+
return this.client.get("/v1/oma/evals/runs", {
|
|
133
|
+
query: params,
|
|
134
|
+
...withBeta(MANAGED_AGENTS_BETA, options),
|
|
135
|
+
});
|
|
141
136
|
}
|
|
142
137
|
retrieve(id, options) {
|
|
143
|
-
return this.client.get(`/v1/oma/evals/runs/${enc(id)}`, withBeta(options));
|
|
138
|
+
return this.client.get(`/v1/oma/evals/runs/${enc(id)}`, withBeta(MANAGED_AGENTS_BETA, options));
|
|
144
139
|
}
|
|
145
140
|
cancel(id, options) {
|
|
146
|
-
return this.client.post(`/v1/oma/evals/runs/${enc(id)}/cancel`, withRetryPolicy("post", withBeta(options)));
|
|
141
|
+
return this.client.post(`/v1/oma/evals/runs/${enc(id)}/cancel`, withRetryPolicy("post", withBeta(MANAGED_AGENTS_BETA, options)));
|
|
147
142
|
}
|
|
148
143
|
delete(id, options) {
|
|
149
|
-
return this.client.delete(`/v1/oma/evals/runs/${enc(id)}`, withBeta(options));
|
|
144
|
+
return this.client.delete(`/v1/oma/evals/runs/${enc(id)}`, withBeta(MANAGED_AGENTS_BETA, options));
|
|
150
145
|
}
|
|
151
146
|
/** Poll until the run is completed, failed or cancelled; resolves with the terminal run. */
|
|
152
147
|
async waitForRun(id, opts = {}) {
|
|
@@ -181,6 +176,9 @@ export class EvalsResource {
|
|
|
181
176
|
}
|
|
182
177
|
/** Branches and tags of a github.com / huggingface.co repository, to pick a git source's ref. */
|
|
183
178
|
gitRefs(params, options) {
|
|
184
|
-
return this.client.get("/v1/oma/evals/git-refs", {
|
|
179
|
+
return this.client.get("/v1/oma/evals/git-refs", {
|
|
180
|
+
query: { url: params.url },
|
|
181
|
+
...withBeta(MANAGED_AGENTS_BETA, options),
|
|
182
|
+
});
|
|
185
183
|
}
|
|
186
184
|
}
|