@tokenite/sdk 2.0.0 → 2.0.1
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 +3 -8
- package/dist/admin/types.d.ts +0 -6
- package/dist/client.js +10 -2
- package/dist/types.d.ts +0 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ await fetch('/api/auth/exchange', {
|
|
|
85
85
|
|
|
86
86
|
### Managed agents (Anthropic)
|
|
87
87
|
|
|
88
|
-
Tokenite proxies Anthropic's [Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview) surface — the `/v1/agents`, `/v1/environments`, `/v1/sessions`, `/v1/vaults`, and `/v1/
|
|
88
|
+
Tokenite proxies Anthropic's [Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview) surface — the `/v1/agents`, `/v1/environments`, `/v1/sessions`, `/v1/vaults`, `/v1/files`, and `/v1/skills` endpoints — under the same BYOK model as Messages. The app points the Anthropic SDK at `tk.proxyUrl('anthropic')`; the proxy injects the right beta header per surface (`managed-agents-2026-04-01` for agents/environments/sessions/vaults, `files-api-2025-04-14` for files, `skills-2025-10-02` for skills) and forwards calls to the user's Anthropic org. Client-supplied `anthropic-beta` headers are passed through and merged with the auto-injected ones, so callers can opt into additional betas (e.g. multi-version skills) without losing the proxy-managed defaults.
|
|
89
89
|
|
|
90
90
|
**Explicit consent required.** Because agent sessions run long-lived, billable server-side work on Anthropic (`$0.08/hr` session runtime on top of tokens), the proxy rejects agent-surface calls unless the app was created with `allowsManagedAgents: true`. The flag sits alongside the other app fields on creation:
|
|
91
91
|
|
|
@@ -93,7 +93,8 @@ Tokenite proxies Anthropic's [Managed Agents](https://platform.claude.com/docs/e
|
|
|
93
93
|
await admin.apps.create({
|
|
94
94
|
name: 'Life Coach',
|
|
95
95
|
callbackUrl: 'https://lifecoach.ai/callback',
|
|
96
|
-
|
|
96
|
+
modelStrategy: 'models',
|
|
97
|
+
allowedModels: ['claude-opus-4-7', 'claude-sonnet-4-6'],
|
|
97
98
|
allowsManagedAgents: true, // ← opt in
|
|
98
99
|
});
|
|
99
100
|
```
|
|
@@ -405,12 +406,6 @@ export type AppInfo = {
|
|
|
405
406
|
readonly websiteUrl: string | null;
|
|
406
407
|
/** Absolute URL to the app's icon (PNG/SVG). null when the developer hasn't set one — render initials or a generic glyph. */
|
|
407
408
|
readonly iconUrl: string | null;
|
|
408
|
-
/** Providers the app declares it needs */
|
|
409
|
-
readonly requiredProviders: readonly Provider[];
|
|
410
|
-
/** Fallback order when `allowSubstitution` is true */
|
|
411
|
-
readonly preferredProviders: readonly Provider[];
|
|
412
|
-
/** Whether the app accepts substitute providers when a required one isn't available */
|
|
413
|
-
readonly allowSubstitution: boolean;
|
|
414
409
|
};
|
|
415
410
|
|
|
416
411
|
/**
|
package/dist/admin/types.d.ts
CHANGED
|
@@ -6,9 +6,6 @@ export type AppRecord = {
|
|
|
6
6
|
readonly builderId: string;
|
|
7
7
|
readonly name: string;
|
|
8
8
|
readonly callbackUrl: string;
|
|
9
|
-
readonly requiredProviders: readonly Provider[];
|
|
10
|
-
readonly preferredProviders: readonly Provider[];
|
|
11
|
-
readonly allowSubstitution: boolean;
|
|
12
9
|
readonly allowedModels?: readonly string[];
|
|
13
10
|
readonly modelStrategy: ModelStrategy;
|
|
14
11
|
readonly requiredTier?: RequiredTier;
|
|
@@ -24,9 +21,6 @@ export type CreatedApp = AppRecord & {
|
|
|
24
21
|
export type CreateAppInput = {
|
|
25
22
|
readonly name: string;
|
|
26
23
|
readonly callbackUrl: string;
|
|
27
|
-
readonly requiredProviders: readonly Provider[];
|
|
28
|
-
readonly preferredProviders?: readonly Provider[];
|
|
29
|
-
readonly allowSubstitution?: boolean;
|
|
30
24
|
readonly allowedModels?: readonly string[];
|
|
31
25
|
readonly modelStrategy?: ModelStrategy;
|
|
32
26
|
readonly requiredTier?: RequiredTier;
|
package/dist/client.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { extractErrorMessage } from './error.js';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
// `tokenite.ai` is the marketing site. The dashboard (which hosts the
|
|
3
|
+
// OAuth consent screen and the API the SDK calls — /oauth/authorize,
|
|
4
|
+
// /api/oauth/token) lives at `app.tokenite.ai`. Older versions of this
|
|
5
|
+
// SDK pointed at `tokenite.ai` and only worked because that hostname
|
|
6
|
+
// was aliased to the dashboard CloudFront; the marketing-site move on
|
|
7
|
+
// 2026-05-06 broke that. Marketing CF now redirects /oauth/* and
|
|
8
|
+
// /api/* to app.tokenite.ai, so older SDK installs continue to work,
|
|
9
|
+
// but new installs should hit the dashboard directly.
|
|
10
|
+
const DEFAULT_BASE_URL = 'https://app.tokenite.ai';
|
|
11
|
+
const DEFAULT_PROXY_URL = 'https://proxy.tokenite.ai';
|
|
4
12
|
const IFRAME_WIDTH = 480;
|
|
5
13
|
const IFRAME_HEIGHT = 620;
|
|
6
14
|
/**
|
package/dist/types.d.ts
CHANGED
|
@@ -175,12 +175,6 @@ export type AppInfo = {
|
|
|
175
175
|
readonly websiteUrl: string | null;
|
|
176
176
|
/** Absolute URL to the app's icon (PNG/SVG). null when the developer hasn't set one — render initials or a generic glyph. */
|
|
177
177
|
readonly iconUrl: string | null;
|
|
178
|
-
/** Providers the app declares it needs */
|
|
179
|
-
readonly requiredProviders: readonly Provider[];
|
|
180
|
-
/** Fallback order when `allowSubstitution` is true */
|
|
181
|
-
readonly preferredProviders: readonly Provider[];
|
|
182
|
-
/** Whether the app accepts substitute providers when a required one isn't available */
|
|
183
|
-
readonly allowSubstitution: boolean;
|
|
184
178
|
};
|
|
185
179
|
/**
|
|
186
180
|
* Full access context for a single access token: the app it belongs to,
|
package/package.json
CHANGED