@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.
- package/LICENSE +201 -0
- package/NOTICE +23 -0
- package/README.md +183 -2
- package/dist/agents.d.ts +331 -0
- package/dist/agents.js +1 -0
- package/dist/deployments.d.ts +35 -0
- package/dist/deployments.js +1 -0
- package/dist/environments.d.ts +30 -0
- package/dist/environments.js +1 -0
- package/dist/evals.d.ts +419 -0
- package/dist/evals.js +186 -0
- package/dist/generated/openapi.d.ts +33673 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +90 -0
- package/dist/oma.d.ts +126 -0
- package/dist/oma.js +80 -0
- package/dist/platform/api-keys.d.ts +54 -0
- package/dist/platform/api-keys.js +62 -0
- package/dist/platform/audit-events.d.ts +22 -0
- package/dist/platform/audit-events.js +29 -0
- package/dist/platform/errors.d.ts +30 -0
- package/dist/platform/errors.js +66 -0
- package/dist/platform/http.d.ts +27 -0
- package/dist/platform/http.js +57 -0
- package/dist/platform/me.d.ts +15 -0
- package/dist/platform/me.js +10 -0
- package/dist/platform/model-cards.d.ts +34 -0
- package/dist/platform/model-cards.js +40 -0
- package/dist/platform/privacy-erasure.d.ts +37 -0
- package/dist/platform/privacy-erasure.js +40 -0
- package/dist/platform/rate-limits.d.ts +16 -0
- package/dist/platform/rate-limits.js +14 -0
- package/dist/platform/settings.d.ts +17 -0
- package/dist/platform/settings.js +17 -0
- package/dist/platform/types.d.ts +6 -0
- package/dist/platform/types.js +1 -0
- package/dist/platform/usage-limits.d.ts +34 -0
- package/dist/platform/usage-limits.js +38 -0
- package/dist/platform/usage.d.ts +30 -0
- package/dist/platform/usage.js +34 -0
- package/dist/platform/user-profiles.d.ts +35 -0
- package/dist/platform/user-profiles.js +46 -0
- package/dist/trigger-events.d.ts +36 -0
- package/dist/trigger-events.js +1 -0
- package/package.json +63 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import Anthropic, { type ClientOptions as AnthropicClientOptions } from "@anthropic-ai/sdk";
|
|
2
|
+
import { PlatformResources } from "./oma.js";
|
|
3
|
+
export { PlatformApiError, type PlatformApiErrorFields } from "./platform/errors.js";
|
|
4
|
+
export { UserProfilesResource, USER_PROFILES_BETA, type PlatformUserProfile, type PlatformUserProfileListParams, type PlatformUserProfilePage, type PlatformUserProfileRequest, type PlatformUserProfileUpdateRequest, } from "./platform/user-profiles.js";
|
|
5
|
+
export { UsageResource, type PlatformUsage, type PlatformUsageGroupBy, type PlatformUsageParams, } from "./platform/usage.js";
|
|
6
|
+
export { UsageLimitsResource, type PlatformConsumptionKind, type PlatformUsageConsumption, type PlatformUsageConsumptionParams, type PlatformUsageLimits, type PlatformUsageLimitsParams, type PlatformUsageLimitsUpdate, } from "./platform/usage-limits.js";
|
|
7
|
+
export { RateLimitsResource, type PlatformRateLimitEntry, type PlatformRateLimits, } from "./platform/rate-limits.js";
|
|
8
|
+
export { SettingsResource, type PlatformSettings, type PlatformSettingsUpdate, } from "./platform/settings.js";
|
|
9
|
+
export { PrivacyErasureResource, PRIVACY_ERASURE_BETA, type PlatformErasureRequest, type PlatformErasureRequestCreateParams, type PlatformErasureRequestListParams, type PlatformErasureRequestPage, type PlatformErasureRequestSingle, } from "./platform/privacy-erasure.js";
|
|
10
|
+
export { ApiKeysResource, KEY_PRESETS, type PlatformApiKey, type PlatformApiKeyCreateParams, type PlatformApiKeyCreateResponse, type PlatformApiKeyDeleted, type PlatformApiKeyRotateParams, type PlatformApiKeyRotateResponse, type PlatformApiKeyScope, type PlatformApiKeysPage, type PlatformApiKeyUpdateParams, type PlatformApiKeyUpdateResponse, } from "./platform/api-keys.js";
|
|
11
|
+
export { AuditEventsResource, type PlatformAuditEvent, type PlatformAuditEventsPage, type PlatformAuditEventsParams, } from "./platform/audit-events.js";
|
|
12
|
+
export { MeResource, type PlatformMe } from "./platform/me.js";
|
|
13
|
+
import type { PlatformBeta } from "./agents.js";
|
|
14
|
+
export type { PlatformAgentAcp, PlatformAgentAcpParams, PlatformAgentExtension, PlatformAgentExtensionParams, PlatformAgentModelParams, PlatformAgent, PlatformAgentCreateParams, PlatformAgentUpdateParams, PlatformAgentMultiagentParams, PlatformAgentMultiagent, PlatformMultiagent, PlatformSessionThreadAgent, PlatformSessionAgent, PlatformSession, PlatformSessionCreateParams, PlatformAgents, PlatformSessions, PlatformBeta, PlatformAgentPolicy, PlatformAgentRetention, PlatformMcpToolClass, PlatformMcpToolClassEntry, PlatformMcpServer, PlatformMcpServerParams, PlatformStdioMcpServer, PlatformStdioMcpServerParams, PlatformAgentRuntimeBindingParams, PlatformJsonValue, PlatformProviderOptions, } from "./agents.js";
|
|
15
|
+
export type { PlatformEnvironment, PlatformEnvironmentCreateParams, PlatformEnvironmentUpdateParams, PlatformEnvironments, PlatformNoneEnvironmentConfig, } from "./environments.js";
|
|
16
|
+
export type { PlatformDeploymentRun, PlatformDeploymentRunBodyParams, PlatformDeploymentRunInitialEventParams, PlatformDeploymentRunParams, PlatformDeploymentRunTriggerContext, PlatformEventTriggerContext, } from "./deployments.js";
|
|
17
|
+
export type { PlatformTriggerEvent, PlatformTriggerEventCreateParams, PlatformTriggerEventCreateResponse, PlatformTriggerEventError, PlatformTriggerEventStatus, } from "./trigger-events.js";
|
|
18
|
+
export { PlatformModelsResource, PlatformModelCardsResource, PlatformHarnessesResource, type PlatformHarnessCatalog, type PlatformHarnessDescriptor, type PlatformHarnessExecutionPlacement, PlatformResources, type PlatformModelCard, type PlatformModelCardCreateParams, type PlatformModelCardCreateResponse, type PlatformModelCardDeleted, type PlatformModelCardListParams, type PlatformModelCardListResponse, type PlatformModelCardUpdateParams, type PlatformModelListParams, type PlatformModelListResponse, type PlatformModelProvider, type PlatformPiModelConfig, type PlatformProviderModel, type PlatformHTTPMethod, type PlatformPath, type PlatformRequestParams, } from "./oma.js";
|
|
19
|
+
export { EvalsResource, EvalBenchmarksResource, EvalCasesResource, EvalRunsResource, EVAL_RUN_TERMINAL_STATUSES, type AddEvalCasesRequest, type BuiltinEvalBenchmark, type BuiltinEvalBenchmarkListResponse, type CreateEvalBenchmarkRequest, type CreateEvalRunRequest, type CreateEvalRunResponse, type EvalArchiveUpload, type EvalBenchmark, type EvalBenchmarkDeleted, type EvalBenchmarkKind, type EvalBenchmarkListResponse, type EvalBenchmarkRetrieveParams, type EvalBenchmarkRevision, type EvalCase, type EvalCaseDeleted, type EvalCaseDetail, type EvalCaseRetrieveParams, type EvalGitRef, type EvalGitRefList, type EvalRun, type EvalRunDeleted, type EvalRunListParams, type EvalRunListResponse, type EvalRunStatus, type EvalRunTask, type EvalSourcePin, type EvalTrial, type EvalTrialPhase, type HarborCaseSource, type HarborEvalCase, type MessagesCaseInput, type MessagesEvalCase, type ReplaceEvalCaseRequest, type SyncEvalBenchmarkRequest, type SyncEvalBenchmarkResponse, type SyncUploadEvalBenchmarkParams, type UpdateEvalBenchmarkRequest, type UploadEvalBenchmarkParams, type WaitForEvalRunOptions, } from "./evals.js";
|
|
20
|
+
export { Anthropic };
|
|
21
|
+
export type { AnthropicClientOptions };
|
|
22
|
+
export interface NouterPlatformOptions extends AnthropicClientOptions {
|
|
23
|
+
/** @deprecated Use the official SDK spelling, `baseURL`. */
|
|
24
|
+
baseUrl?: string;
|
|
25
|
+
/** @deprecated Use the official SDK spelling, `authToken`. */
|
|
26
|
+
bearer?: string;
|
|
27
|
+
/** Active Nouter platform workspace. Sent as `x-active-tenant`. */
|
|
28
|
+
activeTenantId?: string;
|
|
29
|
+
/** Optional legacy User-Agent override. */
|
|
30
|
+
userAgent?: string;
|
|
31
|
+
}
|
|
32
|
+
/** @deprecated Use `NouterPlatformOptions`. */
|
|
33
|
+
export type ClientOptions = NouterPlatformOptions;
|
|
34
|
+
export declare class NouterPlatform {
|
|
35
|
+
readonly anthropic: Anthropic;
|
|
36
|
+
readonly beta: PlatformBeta;
|
|
37
|
+
readonly platform: PlatformResources;
|
|
38
|
+
constructor(options?: NouterPlatformOptions);
|
|
39
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import Anthropic, {} from "@anthropic-ai/sdk";
|
|
2
|
+
import { PlatformResources } from "./oma.js";
|
|
3
|
+
export { PlatformApiError } from "./platform/errors.js";
|
|
4
|
+
export { UserProfilesResource, USER_PROFILES_BETA, } from "./platform/user-profiles.js";
|
|
5
|
+
export { UsageResource, } from "./platform/usage.js";
|
|
6
|
+
export { UsageLimitsResource, } from "./platform/usage-limits.js";
|
|
7
|
+
export { RateLimitsResource, } from "./platform/rate-limits.js";
|
|
8
|
+
export { SettingsResource, } from "./platform/settings.js";
|
|
9
|
+
export { PrivacyErasureResource, PRIVACY_ERASURE_BETA, } from "./platform/privacy-erasure.js";
|
|
10
|
+
export { ApiKeysResource, KEY_PRESETS, } from "./platform/api-keys.js";
|
|
11
|
+
export { AuditEventsResource, } from "./platform/audit-events.js";
|
|
12
|
+
export { MeResource } from "./platform/me.js";
|
|
13
|
+
export { PlatformModelsResource, PlatformModelCardsResource, PlatformHarnessesResource, PlatformResources, } from "./oma.js";
|
|
14
|
+
export { EvalsResource, EvalBenchmarksResource, EvalCasesResource, EvalRunsResource, EVAL_RUN_TERMINAL_STATUSES, } from "./evals.js";
|
|
15
|
+
export { Anthropic };
|
|
16
|
+
function mergeDefaultHeaders(defaultHeaders, additions) {
|
|
17
|
+
const merged = {};
|
|
18
|
+
const set = (name, value) => {
|
|
19
|
+
merged[name.toLowerCase()] = value;
|
|
20
|
+
};
|
|
21
|
+
for (const [name, value] of Object.entries(additions))
|
|
22
|
+
set(name, value);
|
|
23
|
+
if (defaultHeaders instanceof Headers) {
|
|
24
|
+
defaultHeaders.forEach((value, name) => set(name, value));
|
|
25
|
+
return merged;
|
|
26
|
+
}
|
|
27
|
+
if (Array.isArray(defaultHeaders)) {
|
|
28
|
+
for (const entry of defaultHeaders) {
|
|
29
|
+
if (entry.length >= 2)
|
|
30
|
+
set(String(entry[0]), entry[1]);
|
|
31
|
+
}
|
|
32
|
+
return merged;
|
|
33
|
+
}
|
|
34
|
+
if (defaultHeaders && typeof defaultHeaders === "object") {
|
|
35
|
+
const nullable = defaultHeaders;
|
|
36
|
+
if (nullable.values instanceof Headers && nullable.nulls instanceof Set) {
|
|
37
|
+
nullable.values.forEach((value, name) => set(name, value));
|
|
38
|
+
for (const name of nullable.nulls)
|
|
39
|
+
set(String(name), null);
|
|
40
|
+
return merged;
|
|
41
|
+
}
|
|
42
|
+
for (const [name, value] of Object.entries(defaultHeaders)) {
|
|
43
|
+
set(name, value);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return merged;
|
|
47
|
+
}
|
|
48
|
+
/** NOUTER PATCH: el SDK no tiene host de API por defecto. Gana `baseURL` (o el
|
|
49
|
+
* `baseUrl` obsoleto), después la variable `NOUTER_PLATFORM_BASE_URL`; si no, falla con un error claro. */
|
|
50
|
+
function resolveBaseURL(explicit) {
|
|
51
|
+
const fromEnv = typeof process !== "undefined" ? process.env?.NOUTER_PLATFORM_BASE_URL : undefined;
|
|
52
|
+
const value = explicit || fromEnv;
|
|
53
|
+
if (!value) {
|
|
54
|
+
throw new Error("Nouter platform: no API base URL. Pass the `baseURL` option or set the NOUTER_PLATFORM_BASE_URL environment variable.");
|
|
55
|
+
}
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
export class NouterPlatform {
|
|
59
|
+
anthropic;
|
|
60
|
+
beta;
|
|
61
|
+
platform;
|
|
62
|
+
constructor(options = {}) {
|
|
63
|
+
const { activeTenantId, apiKey, baseUrl, bearer, defaultHeaders, userAgent, ...anthropicOptions } = options;
|
|
64
|
+
// Anthropic TS SDK 1.x sends apiKey as Authorization Bearer. Nouter platform's
|
|
65
|
+
// control-plane auth still uses the tenant x-api-key header, so hand-set
|
|
66
|
+
// X-Api-Key and explicitly omit Authorization (SDK validates either).
|
|
67
|
+
// Nouter platform callers pass a string key today. Function setters would still
|
|
68
|
+
// emit Bearer under SDK 1.x, so only string keys are remapped to X-Api-Key.
|
|
69
|
+
const platformApiKey = typeof apiKey === "string" && apiKey.length > 0 ? apiKey : null;
|
|
70
|
+
const authToken = options.authToken ?? bearer ?? null;
|
|
71
|
+
this.anthropic = new Anthropic({
|
|
72
|
+
...anthropicOptions,
|
|
73
|
+
// Prevent SDK 1.x from emitting Authorization: Bearer for the Nouter platform key.
|
|
74
|
+
apiKey: null,
|
|
75
|
+
// NOUTER PATCH: sin URL por defecto de upstream; sale de `baseURL` o de NOUTER_PLATFORM_BASE_URL.
|
|
76
|
+
baseURL: resolveBaseURL(options.baseURL ?? baseUrl),
|
|
77
|
+
authToken,
|
|
78
|
+
defaultHeaders: mergeDefaultHeaders(defaultHeaders, {
|
|
79
|
+
...(platformApiKey ? { "X-Api-Key": platformApiKey } : {}),
|
|
80
|
+
// Omit Authorization only when we are not using authToken Bearer auth.
|
|
81
|
+
...(platformApiKey && !authToken ? { Authorization: null } : {}),
|
|
82
|
+
...(activeTenantId ? { "x-active-tenant": activeTenantId } : {}),
|
|
83
|
+
...(userAgent ? { "user-agent": userAgent } : {}),
|
|
84
|
+
}),
|
|
85
|
+
});
|
|
86
|
+
// Keep the official resources and transport intact; do not normalize patches.
|
|
87
|
+
this.beta = this.anthropic.beta;
|
|
88
|
+
this.platform = new PlatformResources(this.anthropic);
|
|
89
|
+
}
|
|
90
|
+
}
|
package/dist/oma.d.ts
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type Anthropic from "@anthropic-ai/sdk";
|
|
2
|
+
import { EvalsResource } from "./evals.js";
|
|
3
|
+
import { PlatformModelCardsResource } from "./platform/model-cards.js";
|
|
4
|
+
import { UserProfilesResource } from "./platform/user-profiles.js";
|
|
5
|
+
import { UsageResource } from "./platform/usage.js";
|
|
6
|
+
import { UsageLimitsResource } from "./platform/usage-limits.js";
|
|
7
|
+
import { RateLimitsResource } from "./platform/rate-limits.js";
|
|
8
|
+
import { SettingsResource } from "./platform/settings.js";
|
|
9
|
+
import { PrivacyErasureResource } from "./platform/privacy-erasure.js";
|
|
10
|
+
import { ApiKeysResource } from "./platform/api-keys.js";
|
|
11
|
+
import { AuditEventsResource } from "./platform/audit-events.js";
|
|
12
|
+
import { MeResource } from "./platform/me.js";
|
|
13
|
+
export { PlatformModelCardsResource };
|
|
14
|
+
export type { PlatformModelCard, PlatformModelCardCreateParams, PlatformModelCardCreateResponse, PlatformModelCardDeleted, PlatformModelCardListParams, PlatformModelCardListResponse, PlatformModelCardUpdateParams, } from "./platform/model-cards.js";
|
|
15
|
+
/** Pi provider id. Built-ins and user-defined ids share this open shape. */
|
|
16
|
+
export type PlatformModelProvider = string;
|
|
17
|
+
/**
|
|
18
|
+
* Serializable Pi Model fields accepted by a Model Card. Identity, endpoint,
|
|
19
|
+
* and credentials remain first-class Model Card fields and cannot be
|
|
20
|
+
* overridden here.
|
|
21
|
+
*
|
|
22
|
+
* Local structural types: the SDK does not take a runtime dependency (nor a
|
|
23
|
+
* type-only package in its manifest) on the Pi libraries.
|
|
24
|
+
*/
|
|
25
|
+
export interface PlatformPiModelConfig {
|
|
26
|
+
name?: string;
|
|
27
|
+
api?: string;
|
|
28
|
+
reasoning?: boolean;
|
|
29
|
+
/** Maps Pi thinking levels to provider- or model-specific values; null marks a level unsupported. */
|
|
30
|
+
thinkingLevelMap?: Record<string, string | null>;
|
|
31
|
+
input?: Array<"text" | "image">;
|
|
32
|
+
cost?: {
|
|
33
|
+
input: number;
|
|
34
|
+
output: number;
|
|
35
|
+
cacheRead: number;
|
|
36
|
+
cacheWrite: number;
|
|
37
|
+
tiers?: Array<{
|
|
38
|
+
input: number;
|
|
39
|
+
output: number;
|
|
40
|
+
cacheRead: number;
|
|
41
|
+
cacheWrite: number;
|
|
42
|
+
inputTokensAbove: number;
|
|
43
|
+
}>;
|
|
44
|
+
};
|
|
45
|
+
contextWindow?: number;
|
|
46
|
+
maxTokens?: number;
|
|
47
|
+
samplingParams?: Record<string, unknown>;
|
|
48
|
+
headers?: Record<string, string>;
|
|
49
|
+
compat?: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
export interface PlatformProviderModel {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
provider?: string;
|
|
55
|
+
api?: string;
|
|
56
|
+
reasoning?: boolean;
|
|
57
|
+
input?: Array<"text" | "image">;
|
|
58
|
+
context_window?: number;
|
|
59
|
+
max_tokens?: number;
|
|
60
|
+
}
|
|
61
|
+
export interface PlatformModelListParams {
|
|
62
|
+
provider: PlatformModelProvider;
|
|
63
|
+
/** @deprecated The SDK-first Pi catalog does not require provider credentials. */
|
|
64
|
+
apiKey?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface PlatformModelListResponse {
|
|
67
|
+
data: PlatformProviderModel[];
|
|
68
|
+
}
|
|
69
|
+
/** Agent loop location, independent of tool/runtime access. `host` may itself
|
|
70
|
+
* be cloud-hosted; these are descriptors, not Agent execution settings. */
|
|
71
|
+
export type PlatformHarnessExecutionPlacement = "host" | "sandbox" | "runtime" | "unknown";
|
|
72
|
+
export interface PlatformHarnessDescriptor {
|
|
73
|
+
id: string;
|
|
74
|
+
label: string;
|
|
75
|
+
description: string;
|
|
76
|
+
execution: {
|
|
77
|
+
placement: PlatformHarnessExecutionPlacement;
|
|
78
|
+
};
|
|
79
|
+
capabilities: {
|
|
80
|
+
/** Consumes _oma.runtime_binding, not general runtime tool access. null is
|
|
81
|
+
* undeclared. Informational only: never use to clear Agent configuration. */
|
|
82
|
+
runtime_binding: boolean | null;
|
|
83
|
+
};
|
|
84
|
+
/** Required public Agent configuration paths, never configuration values. */
|
|
85
|
+
requirements: string[];
|
|
86
|
+
}
|
|
87
|
+
export interface PlatformHarnessCatalog {
|
|
88
|
+
object: "list";
|
|
89
|
+
data: PlatformHarnessDescriptor[];
|
|
90
|
+
/** Resolved implementation for omitted/null/"default" _oma.harness; null if unset. */
|
|
91
|
+
default_harness_id: string | null;
|
|
92
|
+
}
|
|
93
|
+
export declare class PlatformHarnessesResource {
|
|
94
|
+
private readonly client;
|
|
95
|
+
constructor(client: Anthropic);
|
|
96
|
+
list(options?: Anthropic.RequestOptions): import("@anthropic-ai/sdk").APIPromise<PlatformHarnessCatalog>;
|
|
97
|
+
}
|
|
98
|
+
export type PlatformPath = `/v1/oma/${string}`;
|
|
99
|
+
export type PlatformHTTPMethod = "get" | "post" | "put" | "patch" | "delete";
|
|
100
|
+
export interface PlatformRequestParams extends Omit<Anthropic.RequestOptions, "method" | "path"> {
|
|
101
|
+
method: PlatformHTTPMethod;
|
|
102
|
+
path: PlatformPath;
|
|
103
|
+
}
|
|
104
|
+
export declare class PlatformModelsResource {
|
|
105
|
+
private readonly client;
|
|
106
|
+
constructor(client: Anthropic);
|
|
107
|
+
list(params: PlatformModelListParams, options?: Anthropic.RequestOptions): import("@anthropic-ai/sdk").APIPromise<PlatformModelListResponse>;
|
|
108
|
+
}
|
|
109
|
+
export declare class PlatformResources {
|
|
110
|
+
private readonly client;
|
|
111
|
+
readonly models: PlatformModelsResource;
|
|
112
|
+
readonly modelCards: PlatformModelCardsResource;
|
|
113
|
+
readonly harnesses: PlatformHarnessesResource;
|
|
114
|
+
readonly evals: EvalsResource;
|
|
115
|
+
readonly userProfiles: UserProfilesResource;
|
|
116
|
+
readonly usage: UsageResource;
|
|
117
|
+
readonly usageLimits: UsageLimitsResource;
|
|
118
|
+
readonly rateLimits: RateLimitsResource;
|
|
119
|
+
readonly settings: SettingsResource;
|
|
120
|
+
readonly privacyErasure: PrivacyErasureResource;
|
|
121
|
+
readonly apiKeys: ApiKeysResource;
|
|
122
|
+
readonly auditEvents: AuditEventsResource;
|
|
123
|
+
readonly me: MeResource;
|
|
124
|
+
constructor(client: Anthropic);
|
|
125
|
+
request<Response>(params: PlatformRequestParams): import("@anthropic-ai/sdk").APIPromise<Response>;
|
|
126
|
+
}
|
package/dist/oma.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { EvalsResource } from "./evals.js";
|
|
2
|
+
import { PlatformModelCardsResource } from "./platform/model-cards.js";
|
|
3
|
+
import { UserProfilesResource } from "./platform/user-profiles.js";
|
|
4
|
+
import { UsageResource } from "./platform/usage.js";
|
|
5
|
+
import { UsageLimitsResource } from "./platform/usage-limits.js";
|
|
6
|
+
import { RateLimitsResource } from "./platform/rate-limits.js";
|
|
7
|
+
import { SettingsResource } from "./platform/settings.js";
|
|
8
|
+
import { PrivacyErasureResource } from "./platform/privacy-erasure.js";
|
|
9
|
+
import { ApiKeysResource } from "./platform/api-keys.js";
|
|
10
|
+
import { AuditEventsResource } from "./platform/audit-events.js";
|
|
11
|
+
import { MeResource } from "./platform/me.js";
|
|
12
|
+
import { withRetryPolicy } from "./platform/http.js";
|
|
13
|
+
export { PlatformModelCardsResource };
|
|
14
|
+
export class PlatformHarnessesResource {
|
|
15
|
+
client;
|
|
16
|
+
constructor(client) {
|
|
17
|
+
this.client = client;
|
|
18
|
+
}
|
|
19
|
+
list(options) {
|
|
20
|
+
return this.client.get("/v1/oma/harnesses", options);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export class PlatformModelsResource {
|
|
24
|
+
client;
|
|
25
|
+
constructor(client) {
|
|
26
|
+
this.client = client;
|
|
27
|
+
}
|
|
28
|
+
list(params, options) {
|
|
29
|
+
return this.client.post("/v1/oma/models/list", withRetryPolicy("post", {
|
|
30
|
+
body: {
|
|
31
|
+
provider: params.provider,
|
|
32
|
+
...(params.apiKey ? { api_key: params.apiKey } : {}),
|
|
33
|
+
},
|
|
34
|
+
...options,
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export class PlatformResources {
|
|
39
|
+
client;
|
|
40
|
+
models;
|
|
41
|
+
modelCards;
|
|
42
|
+
harnesses;
|
|
43
|
+
evals;
|
|
44
|
+
userProfiles;
|
|
45
|
+
usage;
|
|
46
|
+
usageLimits;
|
|
47
|
+
rateLimits;
|
|
48
|
+
settings;
|
|
49
|
+
privacyErasure;
|
|
50
|
+
apiKeys;
|
|
51
|
+
auditEvents;
|
|
52
|
+
me;
|
|
53
|
+
constructor(client) {
|
|
54
|
+
this.client = client;
|
|
55
|
+
this.models = new PlatformModelsResource(client);
|
|
56
|
+
this.modelCards = new PlatformModelCardsResource(client);
|
|
57
|
+
this.harnesses = new PlatformHarnessesResource(client);
|
|
58
|
+
this.evals = new EvalsResource(client);
|
|
59
|
+
this.userProfiles = new UserProfilesResource(client);
|
|
60
|
+
this.usage = new UsageResource(client);
|
|
61
|
+
this.usageLimits = new UsageLimitsResource(client);
|
|
62
|
+
this.rateLimits = new RateLimitsResource(client);
|
|
63
|
+
this.settings = new SettingsResource(client);
|
|
64
|
+
this.privacyErasure = new PrivacyErasureResource(client);
|
|
65
|
+
this.apiKeys = new ApiKeysResource(client);
|
|
66
|
+
this.auditEvents = new AuditEventsResource(client);
|
|
67
|
+
this.me = new MeResource(client);
|
|
68
|
+
}
|
|
69
|
+
request(params) {
|
|
70
|
+
const { method, path, ...options } = params;
|
|
71
|
+
if (!path.startsWith("/v1/oma/")) {
|
|
72
|
+
throw new TypeError("Nouter platform extension requests must use /v1/oma/* paths");
|
|
73
|
+
}
|
|
74
|
+
return this.client.request({
|
|
75
|
+
...withRetryPolicy(method, options),
|
|
76
|
+
method,
|
|
77
|
+
path,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type Anthropic from "@anthropic-ai/sdk";
|
|
2
|
+
type RequestOptions = Anthropic.RequestOptions;
|
|
3
|
+
import type { operations } from "../generated/openapi.js";
|
|
4
|
+
import type { JsonContent } from "./types.js";
|
|
5
|
+
type ApiKeysResponse = JsonContent<operations["getV1OmaApiKeys"]["responses"][200]>;
|
|
6
|
+
export type PlatformApiKeysPage = ApiKeysResponse;
|
|
7
|
+
/** Una clave tal como la listan `GET /v1/oma/api_keys` y el `PATCH` (nunca lleva la clave en claro). */
|
|
8
|
+
export type PlatformApiKey = ApiKeysResponse["data"][number];
|
|
9
|
+
type ApiKeyCreateBody = JsonContent<operations["postV1OmaApiKeys"]["requestBody"]>;
|
|
10
|
+
export type PlatformApiKeyScope = NonNullable<ApiKeyCreateBody["scopes"]>[number];
|
|
11
|
+
/**
|
|
12
|
+
* El cuerpo de crear una clave. `scopes` acepta una lista `readonly`, así un preset (`KEY_PRESETS.backend`) se pasa
|
|
13
|
+
* sin copiarlo a un array mutable.
|
|
14
|
+
*/
|
|
15
|
+
export type PlatformApiKeyCreateParams = Omit<ApiKeyCreateBody, "scopes"> & {
|
|
16
|
+
scopes?: readonly PlatformApiKeyScope[];
|
|
17
|
+
};
|
|
18
|
+
/** La respuesta de crear una clave (201): la clave y su valor en claro (`key`), que viaja solo acá, una vez. */
|
|
19
|
+
export type PlatformApiKeyCreateResponse = JsonContent<operations["postV1OmaApiKeys"]["responses"][201]>;
|
|
20
|
+
type ApiKeyUpdateBody = JsonContent<operations["patchV1OmaApiKeysId"]["requestBody"]>;
|
|
21
|
+
/** El cuerpo del `PATCH`: solo `name` y `status`. Los alcances no se editan: se rota. */
|
|
22
|
+
export type PlatformApiKeyUpdateParams = ApiKeyUpdateBody;
|
|
23
|
+
export type PlatformApiKeyUpdateResponse = JsonContent<operations["patchV1OmaApiKeysId"]["responses"][200]>;
|
|
24
|
+
export type PlatformApiKeyDeleted = JsonContent<operations["deleteV1OmaApiKeysId"]["responses"][200]>;
|
|
25
|
+
/** El cuerpo del `POST /v1/oma/api_keys/:id/rotate`; sin `grace_period_seconds`, la vieja se revoca en el acto. */
|
|
26
|
+
export type PlatformApiKeyRotateParams = Partial<JsonContent<operations["postV1OmaApiKeysIdRotate"]["requestBody"]>>;
|
|
27
|
+
/** La respuesta de rotar (201): la clave nueva, su valor y `rotated_from`. */
|
|
28
|
+
export type PlatformApiKeyRotateResponse = JsonContent<operations["postV1OmaApiKeysIdRotate"]["responses"][201]>;
|
|
29
|
+
/**
|
|
30
|
+
* Los presets de alcances que ofrece la consola al crear una clave, uno por consumidor. Sus valores coinciden con los
|
|
31
|
+
* del servidor; el paquete publicado no importa código interno de la plataforma, así que son una copia que se mantiene
|
|
32
|
+
* igual a la del contrato con un test.
|
|
33
|
+
*/
|
|
34
|
+
export declare const KEY_PRESETS: {
|
|
35
|
+
readonly backend: readonly ["sessions:admin", "vaults:write", "agents:read", "usage:read", "triggers:write", "privacy:write"];
|
|
36
|
+
readonly ci: readonly ["agents:write", "agents:override", "environments:write", "skills:write", "sessions:write", "models:read"];
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* `/v1/oma/api_keys`: crear con `scopes`, `expires_at` y `agent_id`, listar, renombrar, desactivar o activar,
|
|
40
|
+
* revocar y rotar. Las respuestas usan el sobre de texto de `/v1/oma` y los errores salen como `PlatformApiError`.
|
|
41
|
+
*/
|
|
42
|
+
export declare class ApiKeysResource {
|
|
43
|
+
private readonly client;
|
|
44
|
+
constructor(client: Anthropic);
|
|
45
|
+
list(options?: RequestOptions): Promise<PlatformApiKeysPage>;
|
|
46
|
+
create(params?: PlatformApiKeyCreateParams, options?: RequestOptions): Promise<PlatformApiKeyCreateResponse>;
|
|
47
|
+
update(id: string, params: PlatformApiKeyUpdateParams, options?: RequestOptions): Promise<PlatformApiKeyUpdateResponse>;
|
|
48
|
+
disable(id: string, options?: RequestOptions): Promise<PlatformApiKeyUpdateResponse>;
|
|
49
|
+
enable(id: string, options?: RequestOptions): Promise<PlatformApiKeyUpdateResponse>;
|
|
50
|
+
/** Revoca la clave (`DELETE /v1/oma/api_keys/:id`). */
|
|
51
|
+
revoke(id: string, options?: RequestOptions): Promise<PlatformApiKeyDeleted>;
|
|
52
|
+
rotate(id: string, params?: PlatformApiKeyRotateParams, options?: RequestOptions): Promise<PlatformApiKeyRotateResponse>;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { platformRequest } from "./http.js";
|
|
2
|
+
/**
|
|
3
|
+
* Los presets de alcances que ofrece la consola al crear una clave, uno por consumidor. Sus valores coinciden con los
|
|
4
|
+
* del servidor; el paquete publicado no importa código interno de la plataforma, así que son una copia que se mantiene
|
|
5
|
+
* igual a la del contrato con un test.
|
|
6
|
+
*/
|
|
7
|
+
export const KEY_PRESETS = {
|
|
8
|
+
backend: [
|
|
9
|
+
"sessions:admin",
|
|
10
|
+
"vaults:write",
|
|
11
|
+
"agents:read",
|
|
12
|
+
"usage:read",
|
|
13
|
+
"triggers:write",
|
|
14
|
+
"privacy:write",
|
|
15
|
+
],
|
|
16
|
+
ci: [
|
|
17
|
+
"agents:write",
|
|
18
|
+
"agents:override",
|
|
19
|
+
"environments:write",
|
|
20
|
+
"skills:write",
|
|
21
|
+
"sessions:write",
|
|
22
|
+
"models:read",
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* `/v1/oma/api_keys`: crear con `scopes`, `expires_at` y `agent_id`, listar, renombrar, desactivar o activar,
|
|
27
|
+
* revocar y rotar. Las respuestas usan el sobre de texto de `/v1/oma` y los errores salen como `PlatformApiError`.
|
|
28
|
+
*/
|
|
29
|
+
export class ApiKeysResource {
|
|
30
|
+
client;
|
|
31
|
+
constructor(client) {
|
|
32
|
+
this.client = client;
|
|
33
|
+
}
|
|
34
|
+
list(options) {
|
|
35
|
+
return platformRequest(this.client, "get", "/v1/oma/api_keys", options);
|
|
36
|
+
}
|
|
37
|
+
create(params = {}, options) {
|
|
38
|
+
return platformRequest(this.client, "post", "/v1/oma/api_keys", { ...options, body: params });
|
|
39
|
+
}
|
|
40
|
+
update(id, params, options) {
|
|
41
|
+
return platformRequest(this.client, "patch", `/v1/oma/api_keys/${encodeURIComponent(id)}`, {
|
|
42
|
+
...options,
|
|
43
|
+
body: params,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
disable(id, options) {
|
|
47
|
+
return this.update(id, { status: "disabled" }, options);
|
|
48
|
+
}
|
|
49
|
+
enable(id, options) {
|
|
50
|
+
return this.update(id, { status: "active" }, options);
|
|
51
|
+
}
|
|
52
|
+
/** Revoca la clave (`DELETE /v1/oma/api_keys/:id`). */
|
|
53
|
+
revoke(id, options) {
|
|
54
|
+
return platformRequest(this.client, "delete", `/v1/oma/api_keys/${encodeURIComponent(id)}`, options);
|
|
55
|
+
}
|
|
56
|
+
rotate(id, params = {}, options) {
|
|
57
|
+
return platformRequest(this.client, "post", `/v1/oma/api_keys/${encodeURIComponent(id)}/rotate`, {
|
|
58
|
+
...options,
|
|
59
|
+
body: { grace_period_seconds: params.grace_period_seconds ?? 0 },
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type Anthropic from "@anthropic-ai/sdk";
|
|
2
|
+
type RequestOptions = Anthropic.RequestOptions;
|
|
3
|
+
import type { operations } from "../generated/openapi.js";
|
|
4
|
+
import type { JsonContent } from "./types.js";
|
|
5
|
+
type AuditEventsResponse = JsonContent<operations["getV1OmaAuditEvents"]["responses"][200]>;
|
|
6
|
+
export type PlatformAuditEventsPage = AuditEventsResponse;
|
|
7
|
+
/** Una fila de `GET /v1/oma/audit_events`. `action` es abierta: el cliente tolera una que no conoce. */
|
|
8
|
+
export type PlatformAuditEvent = AuditEventsResponse["data"][number];
|
|
9
|
+
type AuditEventsQuery = NonNullable<NonNullable<operations["getV1OmaAuditEvents"]["parameters"]>["query"]>;
|
|
10
|
+
/** Los filtros del contrato: `starting_at` incluye, `ending_at` excluye y `page` es el `next_page` anterior. */
|
|
11
|
+
export type PlatformAuditEventsParams = AuditEventsQuery;
|
|
12
|
+
/**
|
|
13
|
+
* `GET /v1/oma/audit_events`: la auditoría de administración de D-5, de la más nueva a la más vieja, con
|
|
14
|
+
* `has_more`/`next_page` y filtros. Usa el sobre de `/v1`; los errores salen como `PlatformApiError`.
|
|
15
|
+
*/
|
|
16
|
+
export declare class AuditEventsResource {
|
|
17
|
+
private readonly client;
|
|
18
|
+
constructor(client: Anthropic);
|
|
19
|
+
private query;
|
|
20
|
+
list(params?: PlatformAuditEventsParams, options?: RequestOptions): Promise<PlatformAuditEventsPage>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { platformRequest } from "./http.js";
|
|
2
|
+
/**
|
|
3
|
+
* `GET /v1/oma/audit_events`: la auditoría de administración de D-5, de la más nueva a la más vieja, con
|
|
4
|
+
* `has_more`/`next_page` y filtros. Usa el sobre de `/v1`; los errores salen como `PlatformApiError`.
|
|
5
|
+
*/
|
|
6
|
+
export class AuditEventsResource {
|
|
7
|
+
client;
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
query(params) {
|
|
12
|
+
return {
|
|
13
|
+
...(params.starting_at !== undefined && { starting_at: params.starting_at }),
|
|
14
|
+
...(params.ending_at !== undefined && { ending_at: params.ending_at }),
|
|
15
|
+
...(params.action !== undefined && { action: params.action }),
|
|
16
|
+
...(params.target_type !== undefined && { target_type: params.target_type }),
|
|
17
|
+
...(params.target_id !== undefined && { target_id: params.target_id }),
|
|
18
|
+
...(params.actor_id !== undefined && { actor_id: params.actor_id }),
|
|
19
|
+
...(params.limit !== undefined && { limit: params.limit }),
|
|
20
|
+
...(params.page !== undefined && { page: params.page }),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
list(params = {}, options) {
|
|
24
|
+
return platformRequest(this.client, "get", "/v1/oma/audit_events", {
|
|
25
|
+
...options,
|
|
26
|
+
query: this.query(params),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { APIError } from "@anthropic-ai/sdk";
|
|
2
|
+
/**
|
|
3
|
+
* El error de los recursos de platform que el SDK convierte: junta los dos sobres de error de la API.
|
|
4
|
+
*
|
|
5
|
+
* - `ApiError` (`/v1` y la familia `v1` de `/v1/oma`):
|
|
6
|
+
* `{ type: "error", error: { type, message, retryable, details }, request_id }`.
|
|
7
|
+
* - El sobre de texto (la familia `text` de `/v1/oma`): `{ error: string, error_code?, request_id }`.
|
|
8
|
+
*
|
|
9
|
+
* La familia se resuelve por la forma del cuerpo, no por una copia de los prefijos de `admin-contract.ts`: el SDK
|
|
10
|
+
* publicado no importa paquetes internos y una copia de la lista quedaría vieja sin que nadie lo note. Las dos formas
|
|
11
|
+
* no se solapan: en `ApiError` `error` es un objeto y en el sobre de texto es un string.
|
|
12
|
+
*/
|
|
13
|
+
export interface PlatformApiErrorFields {
|
|
14
|
+
status: number;
|
|
15
|
+
type: string;
|
|
16
|
+
message: string;
|
|
17
|
+
errorCode: string | null;
|
|
18
|
+
retryable: boolean;
|
|
19
|
+
requestId: string | null;
|
|
20
|
+
}
|
|
21
|
+
export declare class PlatformApiError extends Error implements PlatformApiErrorFields {
|
|
22
|
+
readonly status: number;
|
|
23
|
+
readonly type: string;
|
|
24
|
+
readonly errorCode: string | null;
|
|
25
|
+
readonly retryable: boolean;
|
|
26
|
+
readonly requestId: string | null;
|
|
27
|
+
constructor(fields: PlatformApiErrorFields);
|
|
28
|
+
/** Convierte el `APIError` del cliente oficial, que trae el cuerpo ya parseado, al error del SDK. */
|
|
29
|
+
static fromAPIError(error: APIError): PlatformApiError;
|
|
30
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { APIConnectionError, APIError } from "@anthropic-ai/sdk";
|
|
2
|
+
export class PlatformApiError extends Error {
|
|
3
|
+
status;
|
|
4
|
+
type;
|
|
5
|
+
errorCode;
|
|
6
|
+
retryable;
|
|
7
|
+
requestId;
|
|
8
|
+
constructor(fields) {
|
|
9
|
+
super(fields.message);
|
|
10
|
+
this.name = "PlatformApiError";
|
|
11
|
+
this.status = fields.status;
|
|
12
|
+
this.type = fields.type;
|
|
13
|
+
this.errorCode = fields.errorCode;
|
|
14
|
+
this.retryable = fields.retryable;
|
|
15
|
+
this.requestId = fields.requestId;
|
|
16
|
+
}
|
|
17
|
+
/** Convierte el `APIError` del cliente oficial, que trae el cuerpo ya parseado, al error del SDK. */
|
|
18
|
+
static fromAPIError(error) {
|
|
19
|
+
const body = asRecord(error.error);
|
|
20
|
+
const status = error.status ?? 0;
|
|
21
|
+
if (body !== undefined && body.type === "error" && asRecord(body.error) !== undefined) {
|
|
22
|
+
const inner = asRecord(body.error);
|
|
23
|
+
const details = asRecord(inner.details);
|
|
24
|
+
return new PlatformApiError({
|
|
25
|
+
status,
|
|
26
|
+
type: typeof inner.type === "string" ? inner.type : "error",
|
|
27
|
+
message: typeof inner.message === "string" ? inner.message : error.message,
|
|
28
|
+
errorCode: typeof details?.error_code === "string" ? details.error_code : null,
|
|
29
|
+
retryable: inner.retryable === true,
|
|
30
|
+
requestId: requestIdOf(body, error),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
if (body !== undefined && typeof body.error === "string") {
|
|
34
|
+
return new PlatformApiError({
|
|
35
|
+
status,
|
|
36
|
+
type: "error",
|
|
37
|
+
message: body.error,
|
|
38
|
+
// El código estable y opcional: los `403` de la guarda, de la cookie y de Members.
|
|
39
|
+
errorCode: typeof body.error_code === "string" ? body.error_code : null,
|
|
40
|
+
// El sobre de texto no trae `retryable`: se deduce del estado, como el servidor.
|
|
41
|
+
retryable: status === 429 || status >= 500,
|
|
42
|
+
requestId: requestIdOf(body, error),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return new PlatformApiError({
|
|
46
|
+
status,
|
|
47
|
+
type: error.type ?? "error",
|
|
48
|
+
message: error.message,
|
|
49
|
+
errorCode: error.errorCode ?? null,
|
|
50
|
+
// Sin respuesta HTTP (conexión rechazada, DNS, timeout) el pedido no llegó: se puede reintentar. El timeout
|
|
51
|
+
// hereda de `APIConnectionError`, así que la misma comprobación lo cubre.
|
|
52
|
+
retryable: error instanceof APIConnectionError || status === 429 || status >= 500,
|
|
53
|
+
requestId: error.requestID ?? null,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function requestIdOf(body, error) {
|
|
58
|
+
if (typeof body.request_id === "string")
|
|
59
|
+
return body.request_id;
|
|
60
|
+
return error.requestID ?? null;
|
|
61
|
+
}
|
|
62
|
+
function asRecord(value) {
|
|
63
|
+
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
64
|
+
? value
|
|
65
|
+
: undefined;
|
|
66
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type Anthropic from "@anthropic-ai/sdk";
|
|
2
|
+
type RequestOptions = Anthropic.RequestOptions;
|
|
3
|
+
export type PlatformMethod = "get" | "post" | "put" | "patch" | "delete";
|
|
4
|
+
/** Las opciones del cliente oficial más el cuerpo y el query de las rutas de platform. */
|
|
5
|
+
export interface PlatformRequestOptions extends Omit<RequestOptions, "body" | "query"> {
|
|
6
|
+
body?: unknown;
|
|
7
|
+
query?: object | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* La política de reintentos de las rutas de platform: un `POST` no se reintenta salvo que el llamador pida
|
|
11
|
+
* `maxRetries`. Las rutas de `client.platform` y las extensiones de `/v1/oma` (evals, modelos, `platform.request`) no
|
|
12
|
+
* montan el middleware de `Idempotency-Key`: el servidor solo lo honra en `POST /v1/sessions`, en el `run` de
|
|
13
|
+
* deployments y en el append de eventos (`POST /v1/sessions/{id}/events`, que lo hace la aplicación, atado a la sesión
|
|
14
|
+
* y sin vencimiento), que van por `client.beta` y conservan los reintentos oficiales del cliente. Un POST de platform
|
|
15
|
+
* reintentado tras un 5xx o un corte puede crear dos claves, rotar dos veces o duplicar un pedido de borrado.
|
|
16
|
+
*/
|
|
17
|
+
export declare function withRetryPolicy<T extends RequestOptions>(method: PlatformMethod, options: T): T;
|
|
18
|
+
/**
|
|
19
|
+
* Una llamada por el transporte oficial que traduce un `APIError` a `PlatformApiError`. Los recursos de platform la
|
|
20
|
+
* usan para que el error sea uno solo, lea el sobre que lea.
|
|
21
|
+
*/
|
|
22
|
+
export declare function platformRequest<Response>(client: Anthropic, method: PlatformMethod, path: string, options?: PlatformRequestOptions): Promise<Response>;
|
|
23
|
+
/** Suma headers a los que pase el llamador, sin perder el `Headers` ni las tuplas del cliente oficial. */
|
|
24
|
+
export declare function withHeaders(options: RequestOptions | undefined, additions: Record<string, string>): RequestOptions;
|
|
25
|
+
/** Suma el `anthropic-beta` de la ruta a los headers que pase el llamador. */
|
|
26
|
+
export declare function withBeta(beta: string, options?: RequestOptions): RequestOptions;
|
|
27
|
+
export {};
|