@nouter/platform 0.0.0-stage → 0.1.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.
Files changed (45) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +23 -0
  3. package/README.md +183 -2
  4. package/dist/agents.d.ts +331 -0
  5. package/dist/agents.js +1 -0
  6. package/dist/deployments.d.ts +35 -0
  7. package/dist/deployments.js +1 -0
  8. package/dist/environments.d.ts +30 -0
  9. package/dist/environments.js +1 -0
  10. package/dist/evals.d.ts +419 -0
  11. package/dist/evals.js +186 -0
  12. package/dist/generated/openapi.d.ts +33673 -0
  13. package/dist/index.d.ts +39 -0
  14. package/dist/index.js +90 -0
  15. package/dist/oma.d.ts +126 -0
  16. package/dist/oma.js +80 -0
  17. package/dist/platform/api-keys.d.ts +54 -0
  18. package/dist/platform/api-keys.js +62 -0
  19. package/dist/platform/audit-events.d.ts +22 -0
  20. package/dist/platform/audit-events.js +29 -0
  21. package/dist/platform/errors.d.ts +30 -0
  22. package/dist/platform/errors.js +66 -0
  23. package/dist/platform/http.d.ts +27 -0
  24. package/dist/platform/http.js +57 -0
  25. package/dist/platform/me.d.ts +15 -0
  26. package/dist/platform/me.js +10 -0
  27. package/dist/platform/model-cards.d.ts +34 -0
  28. package/dist/platform/model-cards.js +40 -0
  29. package/dist/platform/privacy-erasure.d.ts +37 -0
  30. package/dist/platform/privacy-erasure.js +40 -0
  31. package/dist/platform/rate-limits.d.ts +16 -0
  32. package/dist/platform/rate-limits.js +14 -0
  33. package/dist/platform/settings.d.ts +17 -0
  34. package/dist/platform/settings.js +17 -0
  35. package/dist/platform/types.d.ts +6 -0
  36. package/dist/platform/types.js +1 -0
  37. package/dist/platform/usage-limits.d.ts +34 -0
  38. package/dist/platform/usage-limits.js +38 -0
  39. package/dist/platform/usage.d.ts +30 -0
  40. package/dist/platform/usage.js +34 -0
  41. package/dist/platform/user-profiles.d.ts +35 -0
  42. package/dist/platform/user-profiles.js +46 -0
  43. package/dist/trigger-events.d.ts +36 -0
  44. package/dist/trigger-events.js +1 -0
  45. package/package.json +63 -4
@@ -0,0 +1,331 @@
1
+ import type { AgentCreateParams, AgentUpdateParams, BetaManagedAgentsAgent, BetaManagedAgentsMCPServerURLDefinition, BetaManagedAgentsURLMCPServerParams, BetaManagedAgentsModel, BetaManagedAgentsModelConfig, BetaManagedAgentsModelConfigParams } from "@anthropic-ai/sdk/resources/beta/agents/agents";
2
+ import type Anthropic from "@anthropic-ai/sdk";
3
+ import type { SessionCreateParams } from "@anthropic-ai/sdk/resources/beta/sessions/sessions";
4
+ import type { APIPromise } from "@anthropic-ai/sdk/api-promise";
5
+ import type { PlatformEnvironments } from "./environments.js";
6
+ import type { BidirectionalPageCursor, PageCursor, PagePromise } from "@anthropic-ai/sdk/core/pagination";
7
+ export type PlatformJsonValue = string | number | boolean | null | PlatformProviderOptions | PlatformJsonValue[];
8
+ export interface PlatformProviderOptions {
9
+ [key: string]: PlatformJsonValue;
10
+ }
11
+ export type PlatformAgentModelParams = BetaManagedAgentsModel | BetaManagedAgentsModelConfigParams;
12
+ /** Las siete clases de una tool MCP; una tool sin entrada cuenta como `write`. */
13
+ export type PlatformMcpToolClass = "read" | "draft" | "write" | "destructive" | "network" | "memory" | "exec";
14
+ export interface PlatformMcpToolClassEntry {
15
+ name: string;
16
+ class: PlatformMcpToolClass;
17
+ }
18
+ /** Nouter platform extension for a standard MCP process launched inside the sandbox. */
19
+ export interface PlatformStdioMcpServerParams {
20
+ name: string;
21
+ type: "stdio";
22
+ /** Absolute executable path inside the sandbox. */
23
+ command: string;
24
+ args?: string[];
25
+ env?: Record<string, string>;
26
+ tools?: PlatformMcpToolClassEntry[];
27
+ }
28
+ export type PlatformMcpServerParams = BetaManagedAgentsURLMCPServerParams | PlatformStdioMcpServerParams;
29
+ export interface PlatformStdioMcpServer {
30
+ name: string;
31
+ type: "stdio";
32
+ command: string;
33
+ args?: string[];
34
+ env?: Record<string, string>;
35
+ tools?: PlatformMcpToolClassEntry[];
36
+ }
37
+ export type PlatformMcpServer = BetaManagedAgentsMCPServerURLDefinition | PlatformStdioMcpServer;
38
+ export interface PlatformAgentMultiagentParams {
39
+ type: "multiagent_20261001";
40
+ /** The current runtime supports disabled only. */
41
+ advisor?: {
42
+ type: "disabled";
43
+ } | null;
44
+ /** Omit to preserve on update; null resets to the official default: subagents and inline agents enabled. */
45
+ subagents?: {
46
+ type: "disabled";
47
+ } | {
48
+ type: "enabled";
49
+ inline_agents?: {
50
+ type: "enabled";
51
+ } | {
52
+ type: "disabled";
53
+ } | null;
54
+ predefined_agents?: Array<string | {
55
+ type: "agent";
56
+ id: string;
57
+ version?: number;
58
+ } | {
59
+ type: "self";
60
+ }> | null;
61
+ } | null;
62
+ /** The current runtime supports disabled only. */
63
+ workflows?: {
64
+ type: "disabled";
65
+ } | null;
66
+ }
67
+ export interface PlatformMultiagent<Agent> {
68
+ type: "multiagent_20261001";
69
+ advisor: {
70
+ type: "disabled";
71
+ };
72
+ subagents: {
73
+ type: "disabled";
74
+ } | {
75
+ type: "enabled";
76
+ inline_agents: {
77
+ type: "enabled";
78
+ } | {
79
+ type: "disabled";
80
+ };
81
+ predefined_agents: Agent[];
82
+ };
83
+ workflows: {
84
+ type: "disabled";
85
+ };
86
+ }
87
+ export type PlatformAgentMultiagent = PlatformMultiagent<{
88
+ type: "agent";
89
+ id: string;
90
+ version: number;
91
+ }>;
92
+ export type PlatformAgentCreateParams = Omit<AgentCreateParams, "mcp_servers" | "multiagent" | "model"> & {
93
+ /** Opcional: sin `model`, la aplicación guarda el default de la organización o da 400 si no hay (D-4). */
94
+ model?: PlatformAgentModelParams;
95
+ mcp_servers?: PlatformMcpServerParams[];
96
+ multiagent?: PlatformAgentMultiagentParams | null;
97
+ };
98
+ export type PlatformAgentUpdateParams = Omit<AgentUpdateParams, "mcp_servers" | "multiagent"> & {
99
+ mcp_servers?: PlatformMcpServerParams[] | null;
100
+ multiagent?: PlatformAgentMultiagentParams | null;
101
+ };
102
+ export type PlatformAgent = Omit<BetaManagedAgentsAgent, "mcp_servers" | "multiagent"> & {
103
+ mcp_servers: PlatformMcpServer[];
104
+ multiagent: PlatformAgentMultiagent | null;
105
+ };
106
+ export type PlatformSessionThreadAgent = Omit<import("@anthropic-ai/sdk/resources/beta/agents/agents").BetaManagedAgentsSessionThreadAgent, "mcp_servers"> & {
107
+ mcp_servers: PlatformMcpServer[];
108
+ };
109
+ export type PlatformSessionAgent = Omit<import("@anthropic-ai/sdk/resources/beta/sessions/sessions").BetaManagedAgentsSessionAgent, "multiagent" | "mcp_servers"> & {
110
+ mcp_servers: PlatformMcpServer[];
111
+ multiagent: PlatformMultiagent<PlatformSessionThreadAgent> | null;
112
+ };
113
+ export type PlatformSession = Omit<import("@anthropic-ai/sdk/resources/beta/sessions/sessions").BetaManagedAgentsSession, "agent"> & {
114
+ agent: PlatformSessionAgent;
115
+ /** Lo que la sesión corre: `none` no tiene sandbox (2c); una sesión sin el campo corre con sandbox. */
116
+ _oma?: {
117
+ sandbox_mode?: "sandbox" | "none";
118
+ };
119
+ };
120
+ type OfficialAgents = Anthropic["beta"]["agents"];
121
+ type OfficialSessions = Anthropic["beta"]["sessions"];
122
+ export type PlatformAgents = Omit<OfficialAgents, "create" | "update" | "retrieve" | "archive" | "list" | "versions"> & {
123
+ create(params: PlatformAgentCreateParams, options?: Anthropic.RequestOptions): APIPromise<PlatformAgent>;
124
+ update(agentID: string, params: PlatformAgentUpdateParams, options?: Anthropic.RequestOptions): APIPromise<PlatformAgent>;
125
+ retrieve(...args: Parameters<OfficialAgents["retrieve"]>): APIPromise<PlatformAgent>;
126
+ archive(...args: Parameters<OfficialAgents["archive"]>): APIPromise<PlatformAgent>;
127
+ list(...args: Parameters<OfficialAgents["list"]>): PagePromise<PageCursor<PlatformAgent>, PlatformAgent>;
128
+ versions: Omit<OfficialAgents["versions"], "list"> & {
129
+ list(...args: Parameters<OfficialAgents["versions"]["list"]>): PagePromise<PageCursor<PlatformAgent>, PlatformAgent>;
130
+ };
131
+ };
132
+ export type PlatformSessions = Omit<OfficialSessions, "create" | "retrieve" | "update" | "archive" | "list"> & {
133
+ [Method in "create" | "retrieve" | "update" | "archive"]: (...args: Parameters<OfficialSessions[Method]>) => APIPromise<PlatformSession>;
134
+ } & {
135
+ list(...args: Parameters<OfficialSessions["list"]>): PagePromise<BidirectionalPageCursor<PlatformSession>, PlatformSession>;
136
+ };
137
+ /** El alta de sesión que acepta platform; suma `user_profile_id` (2a). */
138
+ export type PlatformSessionCreateParams = SessionCreateParams;
139
+ export type PlatformBeta = Omit<Anthropic["beta"], "agents" | "sessions" | "environments"> & {
140
+ agents: PlatformAgents;
141
+ environments: PlatformEnvironments;
142
+ sessions: PlatformSessions;
143
+ };
144
+ export interface PlatformAgentAcpParams {
145
+ agent: {
146
+ id?: string;
147
+ /** Explicit process; exactly one of `command` or `registry` is set. */
148
+ command?: string;
149
+ /** Pinned ACP registry reference such as `claude-acp@0.94.0`. */
150
+ registry?: string;
151
+ args?: string[];
152
+ env?: Record<string, string | null>;
153
+ cwd?: string;
154
+ };
155
+ restart?: {
156
+ mode: "never" | "on-crash" | "always";
157
+ max_restarts?: number;
158
+ window_ms?: number;
159
+ };
160
+ idle_timeout_ms?: number;
161
+ per_turn_timeout_ms?: number;
162
+ }
163
+ export interface PlatformAgentRuntimeBindingParams {
164
+ runtime_id: string;
165
+ acp_agent_id: string;
166
+ local_skill_blocklist?: string[];
167
+ }
168
+ /** Nouter platform's namespaced additions to an Agent create or update payload. */
169
+ export interface PlatformContextManagementParams {
170
+ edits: Array<{
171
+ type: "compact" | "compact_20260112";
172
+ trigger?: {
173
+ type: "input_tokens";
174
+ value: number;
175
+ };
176
+ instructions?: string;
177
+ pause_after_compaction?: boolean;
178
+ }>;
179
+ }
180
+ export interface PlatformOpenAiModelSettingsParams {
181
+ max_tokens?: number;
182
+ context_management?: Array<{
183
+ type: "compaction";
184
+ compact_threshold: number;
185
+ }>;
186
+ }
187
+ /** `_oma.retention`: días de retención de las sesiones del agente; `null` hereda el default. */
188
+ export interface PlatformAgentRetention {
189
+ session_days: number | null;
190
+ }
191
+ /** `_oma.policy`: la audiencia, las tools y los límites de un agente (2a solo los guarda y devuelve). */
192
+ export interface PlatformAgentPolicy {
193
+ audience?: "internal" | "end_user";
194
+ tools?: {
195
+ allow?: string[];
196
+ deny?: string[];
197
+ ask?: string[];
198
+ unclassified?: "write";
199
+ };
200
+ memory?: {
201
+ enabled?: boolean;
202
+ scope?: "user_profile";
203
+ retention_days?: number | null;
204
+ purge_on_erasure?: boolean;
205
+ };
206
+ network?: {
207
+ external?: boolean;
208
+ allowed_links?: string[];
209
+ };
210
+ environments?: {
211
+ types?: Array<"none" | "sandbox" | "cloud" | "self_hosted">;
212
+ };
213
+ model_data?: boolean;
214
+ guardrails?: {
215
+ max_message_bytes?: number;
216
+ max_blocks?: number;
217
+ max_initial_events?: number;
218
+ max_events_per_request?: number;
219
+ lock_overrides?: boolean;
220
+ max_turns?: number;
221
+ };
222
+ }
223
+ export interface PlatformAgentExtensionParams {
224
+ aux_model?: PlatformAgentModelParams | null;
225
+ appendable_prompts?: string[] | null;
226
+ /** Anthropic Messages-style compaction (OMA extension under `_oma`). */
227
+ context_management?: PlatformContextManagementParams | null;
228
+ /** OpenAI Agents SDK-style compaction and output limits. */
229
+ model_settings?: PlatformOpenAiModelSettingsParams | null;
230
+ /**
231
+ * @deprecated Prefer omitting `harness` (Pi agent-core default). Use `"ai-sdk"` only for the legacy AI SDK loop.
232
+ */
233
+ harness?: string | null;
234
+ acp?: PlatformAgentAcpParams | null;
235
+ runtime_binding?: PlatformAgentRuntimeBindingParams | null;
236
+ enable_general_subagent?: boolean | null;
237
+ requires_user_profile?: boolean;
238
+ retention?: PlatformAgentRetention | null;
239
+ external_facing?: boolean;
240
+ external_models_only?: boolean;
241
+ policy?: PlatformAgentPolicy | null;
242
+ }
243
+ export interface PlatformAgentAcp {
244
+ agent: {
245
+ id?: string;
246
+ /** Explicit process; exactly one of `command` or `registry` is set. */
247
+ command?: string;
248
+ /** Pinned ACP registry reference such as `claude-acp@0.94.0`. */
249
+ registry?: string;
250
+ args?: string[];
251
+ env?: Record<string, string>;
252
+ cwd?: string;
253
+ };
254
+ restart?: {
255
+ mode: "never" | "on-crash" | "always";
256
+ max_restarts?: number;
257
+ window_ms?: number;
258
+ };
259
+ idle_timeout_ms?: number;
260
+ per_turn_timeout_ms?: number;
261
+ }
262
+ /** Nouter platform extension returned with an Agent when at least one value is set. */
263
+ export interface PlatformAgentExtension {
264
+ aux_model?: BetaManagedAgentsModelConfig;
265
+ appendable_prompts?: string[];
266
+ context_management?: PlatformContextManagementParams;
267
+ model_settings?: PlatformOpenAiModelSettingsParams;
268
+ /** @deprecated Legacy harness id; unset uses Pi. `"ai-sdk"` selects the deprecated AI SDK loop. */
269
+ harness?: string;
270
+ acp?: PlatformAgentAcp;
271
+ runtime_binding?: PlatformAgentRuntimeBindingParams;
272
+ enable_general_subagent?: boolean;
273
+ requires_user_profile?: boolean;
274
+ retention?: PlatformAgentRetention;
275
+ external_facing?: boolean;
276
+ external_models_only?: boolean;
277
+ policy?: PlatformAgentPolicy;
278
+ }
279
+ declare module "@anthropic-ai/sdk/resources/beta/agents/agents" {
280
+ interface BetaManagedAgentsURLMCPServerParams {
281
+ /** `vault` lee la credencial del vault de la sesión; `none` no manda autenticación (2a). */
282
+ auth?: "vault" | "none";
283
+ tools?: PlatformMcpToolClassEntry[];
284
+ }
285
+ interface BetaManagedAgentsMCPServerURLDefinition {
286
+ auth?: "vault" | "none";
287
+ tools?: PlatformMcpToolClassEntry[];
288
+ }
289
+ interface Agents {
290
+ create(params: PlatformAgentCreateParams, options?: Anthropic.RequestOptions): APIPromise<PlatformAgent>;
291
+ update(agentID: string, params: PlatformAgentUpdateParams, options?: Anthropic.RequestOptions): APIPromise<PlatformAgent>;
292
+ }
293
+ interface BetaManagedAgentsModelConfigParams {
294
+ /** Nouter platform extension for provider-namespaced inference options. */
295
+ provider_options?: PlatformProviderOptions | null;
296
+ }
297
+ interface BetaManagedAgentsModelConfig {
298
+ /** Resolved Nouter platform provider-namespaced inference options. */
299
+ provider_options?: PlatformProviderOptions;
300
+ }
301
+ interface AgentCreateParams {
302
+ /** Nouter platform-only settings accepted by Nouter platform endpoints. */
303
+ _oma?: PlatformAgentExtensionParams;
304
+ }
305
+ interface AgentUpdateParams {
306
+ /** Patch Nouter platform-only settings. Omit fields to preserve and use null to clear. */
307
+ _oma?: PlatformAgentExtensionParams;
308
+ }
309
+ interface BetaManagedAgentsAgent {
310
+ /** Nouter platform-only settings pinned to this Agent version. */
311
+ _oma?: PlatformAgentExtension;
312
+ }
313
+ interface BetaManagedAgentsSessionThreadAgent {
314
+ /** Nouter platform-only settings pinned to this thread's Agent version. */
315
+ _oma?: PlatformAgentExtension;
316
+ }
317
+ }
318
+ declare module "@anthropic-ai/sdk/resources/beta/sessions/sessions" {
319
+ interface SessionCreateParams {
320
+ /** El perfil de persona que abre la sesión (2a). */
321
+ user_profile_id?: string;
322
+ }
323
+ interface BetaManagedAgentsSession {
324
+ user_profile_id?: string | null;
325
+ }
326
+ interface BetaManagedAgentsSessionAgent {
327
+ /** Nouter platform-only settings pinned when the Session was created. */
328
+ _oma?: PlatformAgentExtension;
329
+ }
330
+ }
331
+ export {};
package/dist/agents.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,35 @@
1
+ import type { BetaManagedAgentsDeploymentInitialEventParams, DeploymentRunParams } from "@anthropic-ai/sdk/resources/beta/deployments";
2
+ import type { BetaManagedAgentsDeploymentRun, BetaManagedAgentsTriggerContext } from "@anthropic-ai/sdk/resources/beta/deployment-runs";
3
+ /**
4
+ * Los eventos del `run` son los del alta de sesión (`user.message` y `user.define_outcome`), no los del alta del
5
+ * deployment: `system.message` lo rechaza el servidor con 400.
6
+ */
7
+ export type PlatformDeploymentRunInitialEventParams = Extract<BetaManagedAgentsDeploymentInitialEventParams, {
8
+ type: "user.message" | "user.define_outcome";
9
+ }>;
10
+ /**
11
+ * El cuerpo opcional de `POST /v1/deployments/:id/run`. Todo opcional: sin cuerpo, `run` hace lo de siempre.
12
+ * `initial_events` reemplaza a los del deployment; `metadata` se combina sobre la del deployment y gana la corrida;
13
+ * `user_profile_id` es la persona de la sesión.
14
+ */
15
+ export interface PlatformDeploymentRunBodyParams {
16
+ initial_events?: Array<PlatformDeploymentRunInitialEventParams>;
17
+ metadata?: Record<string, string>;
18
+ user_profile_id?: string;
19
+ }
20
+ /** El `run` del SDK oficial más el cuerpo de Nouter platform. */
21
+ export type PlatformDeploymentRunParams = DeploymentRunParams & PlatformDeploymentRunBodyParams;
22
+ /** El contexto de una corrida que disparó un evento durable. */
23
+ export interface PlatformEventTriggerContext {
24
+ type: "event";
25
+ trigger_event_id: string;
26
+ }
27
+ /** El `trigger_context` del SDK oficial (`manual` y `schedule`) más `event`. */
28
+ export type PlatformDeploymentRunTriggerContext = BetaManagedAgentsTriggerContext | PlatformEventTriggerContext;
29
+ /** Una corrida con el `error_code` estable del alta y el contexto del evento. */
30
+ export type PlatformDeploymentRun = Omit<BetaManagedAgentsDeploymentRun, "error" | "trigger_context"> & {
31
+ error: (Exclude<BetaManagedAgentsDeploymentRun["error"], null> & {
32
+ error_code?: string;
33
+ }) | null;
34
+ trigger_context: PlatformDeploymentRunTriggerContext;
35
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,30 @@
1
+ import type Anthropic from "@anthropic-ai/sdk";
2
+ import type { APIPromise } from "@anthropic-ai/sdk/api-promise";
3
+ import type { PageCursor, PagePromise } from "@anthropic-ai/sdk/core/pagination";
4
+ import type { BetaEnvironment, EnvironmentCreateParams, EnvironmentUpdateParams } from "@anthropic-ai/sdk/resources/beta/environments/environments";
5
+ /**
6
+ * Extensión de Nouter platform: entorno `none`, pensado para que el agente solo converse.
7
+ * Hasta que entre PLT-1 completa (enero), una sesión sobre un entorno `none`
8
+ * corre con sandbox, como un `cloud` con los valores por defecto.
9
+ */
10
+ export interface PlatformNoneEnvironmentConfig {
11
+ type: "none";
12
+ }
13
+ export type PlatformEnvironment = Omit<BetaEnvironment, "config"> & {
14
+ config: BetaEnvironment["config"] | PlatformNoneEnvironmentConfig;
15
+ };
16
+ export type PlatformEnvironmentCreateParams = Omit<EnvironmentCreateParams, "config"> & {
17
+ config?: EnvironmentCreateParams["config"] | PlatformNoneEnvironmentConfig | null;
18
+ };
19
+ export type PlatformEnvironmentUpdateParams = Omit<EnvironmentUpdateParams, "config"> & {
20
+ config?: EnvironmentUpdateParams["config"] | PlatformNoneEnvironmentConfig | null;
21
+ };
22
+ type OfficialEnvironments = Anthropic["beta"]["environments"];
23
+ export type PlatformEnvironments = Omit<OfficialEnvironments, "create" | "retrieve" | "update" | "list" | "archive"> & {
24
+ create(params: PlatformEnvironmentCreateParams, options?: Anthropic.RequestOptions): APIPromise<PlatformEnvironment>;
25
+ retrieve(...args: Parameters<OfficialEnvironments["retrieve"]>): APIPromise<PlatformEnvironment>;
26
+ update(environmentID: string, params: PlatformEnvironmentUpdateParams, options?: Anthropic.RequestOptions): APIPromise<PlatformEnvironment>;
27
+ archive(...args: Parameters<OfficialEnvironments["archive"]>): APIPromise<PlatformEnvironment>;
28
+ list(...args: Parameters<OfficialEnvironments["list"]>): PagePromise<PageCursor<PlatformEnvironment>, PlatformEnvironment>;
29
+ };
30
+ export {};
@@ -0,0 +1 @@
1
+ export {};