@inferencesh/sdk 0.6.54 → 0.7.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/CHANGELOG.md +10 -0
- package/README.md +13 -12
- package/dist/api/{integrations.d.ts → credentials.d.ts} +11 -11
- package/dist/api/{integrations.js → credentials.js} +11 -11
- package/dist/api/sockets.d.ts +1 -0
- package/dist/api/sockets.js +14 -11
- package/dist/index.d.ts +9 -5
- package/dist/index.js +11 -5
- package/dist/live/schema.d.ts +5 -0
- package/dist/live/schema.js +16 -5
- package/dist/live/session.d.ts +11 -0
- package/dist/live/session.js +19 -4
- package/dist/tool-builder.d.ts +15 -5
- package/dist/tool-builder.js +21 -9
- package/dist/types.d.ts +101 -20
- package/dist/types.js +23 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.7.0] - 2026-09-23
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- `client.credentials` (`CredentialsAPI`) replaces `client.integrations` / `IntegrationsAPI`; both old names remain as deprecated aliases
|
|
15
|
+
- `httpTool().auth({ credential, credentialId })` writes auth type `credential`; `integration` / `integrationId` still work
|
|
16
|
+
- Requirement errors use type `credential` (was `integration`); check against `RequirementTypeCredential`
|
|
17
|
+
- `CredentialsAPI.checkRequirements` is typed (`CheckRequirementsRequest` with `credentials`, `CheckRequirementsResponse`)
|
|
18
|
+
- API key scopes are `credentials:read` / `credentials:write` (`integrations:*` keys keep working)
|
|
19
|
+
|
|
10
20
|
## [0.6.8] - 2026-05-20
|
|
11
21
|
|
|
12
22
|
### Added
|
package/README.md
CHANGED
|
@@ -377,7 +377,7 @@ Use the fluent builders to define `AgentTool` schemas. Client tools (`tool`) run
|
|
|
377
377
|
| `agentTool(name, agentRef)` | Server | Delegate to a sub-agent |
|
|
378
378
|
| `httpTool(name, url)` / `callTool(name, url)` | Server | HTTP request with credential injection (preferred over `webhookTool`) |
|
|
379
379
|
| `webhookTool(name, url)` | Server | Unsigned webhook (legacy; use `httpTool` for new tools) |
|
|
380
|
-
| `mcpTool(name,
|
|
380
|
+
| `mcpTool(name, credentialId, toolName)` | Server | Call a tool through a connected MCP credential |
|
|
381
381
|
| `internalTools()` | Server | Built-in plan, memory, and widget tools |
|
|
382
382
|
|
|
383
383
|
```typescript
|
|
@@ -397,11 +397,11 @@ const clientTool = tool('get_weather')
|
|
|
397
397
|
.param('city', string('City name'))
|
|
398
398
|
.build();
|
|
399
399
|
|
|
400
|
-
// HTTP tool with
|
|
400
|
+
// HTTP tool authenticated with a connected account (token injected server-side)
|
|
401
401
|
const gmailSend = httpTool('gmail_send', 'https://gmail.googleapis.com/gmail/v1/users/me/messages/send')
|
|
402
402
|
.describe('Send an email via Gmail')
|
|
403
403
|
.method('POST')
|
|
404
|
-
.auth({
|
|
404
|
+
.auth({ credential: CredentialProviderGoogle, credentialId: 'your-credential-id' })
|
|
405
405
|
.build();
|
|
406
406
|
|
|
407
407
|
// API key or bearer auth
|
|
@@ -420,7 +420,7 @@ const imageGen = appTool('generate_image', 'infsh/flux-schnell@abc123')
|
|
|
420
420
|
.requireApproval()
|
|
421
421
|
.build();
|
|
422
422
|
|
|
423
|
-
const mcpSearch = mcpTool('notion_search', 'your-mcp-
|
|
423
|
+
const mcpSearch = mcpTool('notion_search', 'your-mcp-credential-id', 'search')
|
|
424
424
|
.describe('Search Notion pages')
|
|
425
425
|
.param('query', string('Search query'))
|
|
426
426
|
.build();
|
|
@@ -642,9 +642,9 @@ if (task.status === TaskStatusCompleted) {
|
|
|
642
642
|
}
|
|
643
643
|
```
|
|
644
644
|
|
|
645
|
-
##
|
|
645
|
+
## Credential Constants
|
|
646
646
|
|
|
647
|
-
`CredentialDTO` fields (`provider`, `type`, `
|
|
647
|
+
`CredentialDTO` fields (`provider`, `type`, `status`) use typed string unions exported as constants:
|
|
648
648
|
|
|
649
649
|
```typescript
|
|
650
650
|
import type { CredentialDTO } from '@inferencesh/sdk';
|
|
@@ -655,24 +655,25 @@ import {
|
|
|
655
655
|
CredentialStatusDisconnected,
|
|
656
656
|
CredentialStatusExpired,
|
|
657
657
|
CredentialStatusError,
|
|
658
|
+
RequirementTypeCredential,
|
|
658
659
|
isRequirementsNotMetException,
|
|
659
660
|
} from '@inferencesh/sdk';
|
|
660
661
|
|
|
661
|
-
function isGoogleConnected(
|
|
662
|
+
function isGoogleConnected(credential: CredentialDTO): boolean {
|
|
662
663
|
return (
|
|
663
|
-
|
|
664
|
-
|
|
664
|
+
credential.provider === CredentialProviderGoogle &&
|
|
665
|
+
credential.status === CredentialStatusConnected
|
|
665
666
|
);
|
|
666
667
|
}
|
|
667
668
|
|
|
668
|
-
// HTTP 412 when an app requires a missing secret,
|
|
669
|
+
// HTTP 412 when an app requires a missing secret, credential, or scope
|
|
669
670
|
try {
|
|
670
671
|
await client.run({ app: 'my-app', input: {} });
|
|
671
672
|
} catch (error) {
|
|
672
673
|
if (isRequirementsNotMetException(error)) {
|
|
673
674
|
for (const req of error.errors) {
|
|
674
|
-
if (req.type ===
|
|
675
|
-
// User must connect Google — see https://inference.sh/docs/extend/
|
|
675
|
+
if (req.type === RequirementTypeCredential && req.action?.provider === CredentialProviderGoogle) {
|
|
676
|
+
// User must connect Google — see https://inference.sh/docs/extend/credentials
|
|
676
677
|
}
|
|
677
678
|
}
|
|
678
679
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { HttpClient } from '../http/client';
|
|
2
2
|
import type { Response } from '../http/response';
|
|
3
|
-
import { CredentialDTO, CredentialConfigDTO, CredentialConnectRequest, CredentialConnectResponse, CursorListRequest, CursorListResponse } from '../types';
|
|
3
|
+
import { CheckRequirementsRequest, CheckRequirementsResponse, CredentialDTO, CredentialConfigDTO, CredentialConnectRequest, CredentialConnectResponse, CursorListRequest, CursorListResponse } from '../types';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Credentials API: the accounts and keys a team has connected to external services.
|
|
6
6
|
*/
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class CredentialsAPI {
|
|
8
8
|
private readonly http;
|
|
9
9
|
constructor(http: HttpClient);
|
|
10
10
|
/**
|
|
11
|
-
* List
|
|
11
|
+
* List credentials with cursor-based pagination
|
|
12
12
|
*/
|
|
13
13
|
list(params?: Partial<CursorListRequest>): Promise<Response<CursorListResponse<CredentialDTO>>>;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* List the providers a credential can be connected for
|
|
16
16
|
*/
|
|
17
17
|
listAvailable(): Promise<Response<CredentialConfigDTO[]>>;
|
|
18
18
|
/**
|
|
19
|
-
* Get
|
|
19
|
+
* Get provider connection configs
|
|
20
20
|
*/
|
|
21
21
|
getConfigs(): Promise<Response<CredentialConfigDTO[]>>;
|
|
22
22
|
/**
|
|
@@ -24,19 +24,19 @@ export declare class IntegrationsAPI {
|
|
|
24
24
|
*/
|
|
25
25
|
getCapabilities(): Promise<Response<unknown>>;
|
|
26
26
|
/**
|
|
27
|
-
* Check requirements
|
|
27
|
+
* Check whether secret and credential requirements are satisfied
|
|
28
28
|
*/
|
|
29
|
-
checkRequirements(data:
|
|
29
|
+
checkRequirements(data: CheckRequirementsRequest): Promise<Response<CheckRequirementsResponse>>;
|
|
30
30
|
/**
|
|
31
|
-
* Connect
|
|
31
|
+
* Connect a credential
|
|
32
32
|
*/
|
|
33
33
|
connect(data: CredentialConnectRequest): Promise<Response<CredentialConnectResponse>>;
|
|
34
34
|
/**
|
|
35
|
-
* Get
|
|
35
|
+
* Get a credential by provider key
|
|
36
36
|
*/
|
|
37
37
|
get(provider: string): Promise<Response<CredentialDTO>>;
|
|
38
38
|
/**
|
|
39
|
-
* Disconnect
|
|
39
|
+
* Disconnect a credential
|
|
40
40
|
*/
|
|
41
41
|
disconnect(provider: string): Promise<Response<void>>;
|
|
42
42
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Credentials API: the accounts and keys a team has connected to external services.
|
|
3
3
|
*/
|
|
4
|
-
export class
|
|
4
|
+
export class CredentialsAPI {
|
|
5
5
|
constructor(http) {
|
|
6
6
|
this.http = http;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* List
|
|
9
|
+
* List credentials with cursor-based pagination
|
|
10
10
|
*/
|
|
11
11
|
async list(params) {
|
|
12
12
|
return this.http.request('post', '/credentials/list', { data: params });
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* List the providers a credential can be connected for
|
|
16
16
|
*/
|
|
17
17
|
async listAvailable() {
|
|
18
18
|
return this.http.request('get', '/credentials/available');
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* Get
|
|
21
|
+
* Get provider connection configs
|
|
22
22
|
*/
|
|
23
23
|
async getConfigs() {
|
|
24
24
|
return this.http.request('get', '/credentials/configs');
|
|
@@ -30,27 +30,27 @@ export class IntegrationsAPI {
|
|
|
30
30
|
return this.http.request('get', '/credentials/capabilities');
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
* Check requirements
|
|
33
|
+
* Check whether secret and credential requirements are satisfied
|
|
34
34
|
*/
|
|
35
35
|
async checkRequirements(data) {
|
|
36
36
|
return this.http.request('post', '/credentials/check', { data });
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* Connect
|
|
39
|
+
* Connect a credential
|
|
40
40
|
*/
|
|
41
41
|
async connect(data) {
|
|
42
42
|
return this.http.request('post', '/credentials', { data });
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
* Get
|
|
45
|
+
* Get a credential by provider key
|
|
46
46
|
*/
|
|
47
47
|
async get(provider) {
|
|
48
|
-
return this.http.request('get', `/credentials/${provider}`);
|
|
48
|
+
return this.http.request('get', `/credentials/${encodeURIComponent(provider)}`);
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
* Disconnect
|
|
51
|
+
* Disconnect a credential
|
|
52
52
|
*/
|
|
53
53
|
async disconnect(provider) {
|
|
54
|
-
return this.http.request('delete', `/credentials/${provider}`);
|
|
54
|
+
return this.http.request('delete', `/credentials/${encodeURIComponent(provider)}`);
|
|
55
55
|
}
|
|
56
56
|
}
|
package/dist/api/sockets.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export declare class SocketsAPI {
|
|
|
34
34
|
forTask(taskId: string): Promise<SocketDTO | null>;
|
|
35
35
|
/** A fresh credential for the caller's end, e.g. after a reload or to redial. */
|
|
36
36
|
access(id: string): Promise<Response<SocketAccess>>;
|
|
37
|
+
private credentialFor;
|
|
37
38
|
delete(id: string): Promise<Response<void>>;
|
|
38
39
|
/**
|
|
39
40
|
* Dials the caller's end of a stream task's socket. The session is
|
package/dist/api/sockets.js
CHANGED
|
@@ -27,6 +27,12 @@ export class SocketsAPI {
|
|
|
27
27
|
async access(id) {
|
|
28
28
|
return this.http.request('post', `/sockets/${id}/access`);
|
|
29
29
|
}
|
|
30
|
+
async credentialFor(taskId) {
|
|
31
|
+
const socket = await this.forTask(taskId);
|
|
32
|
+
if (!socket)
|
|
33
|
+
throw new Error(`task ${taskId} has no socket: is it a stream function?`);
|
|
34
|
+
return (await this.access(socket.id)).data;
|
|
35
|
+
}
|
|
30
36
|
async delete(id) {
|
|
31
37
|
return this.http.request('delete', `/sockets/${id}`);
|
|
32
38
|
}
|
|
@@ -35,20 +41,17 @@ export class SocketsAPI {
|
|
|
35
41
|
* `waiting` until the app's first frame, then `live`; see LiveSession.
|
|
36
42
|
*/
|
|
37
43
|
async open(target, handlers = {}, options = {}) {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
socketId = socket.id;
|
|
46
|
-
access = (await this.access(socket.id)).data;
|
|
47
|
-
}
|
|
44
|
+
const taskId = typeof target === 'string' ? target : target.id;
|
|
45
|
+
// Given only an id, the task (for the watch) and a credential for its
|
|
46
|
+
// socket are independent: fetch them together.
|
|
47
|
+
const [task, access] = await Promise.all([
|
|
48
|
+
typeof target === 'string' ? this.tasks.get(target).then((res) => res.data) : target,
|
|
49
|
+
(typeof target !== 'string' && target.socket) || this.credentialFor(taskId),
|
|
50
|
+
]);
|
|
48
51
|
const session = new LiveSession({
|
|
49
52
|
access,
|
|
50
53
|
handlers,
|
|
51
|
-
renew: async () => (await this.access(
|
|
54
|
+
renew: async () => (await this.access(access.id)).data,
|
|
52
55
|
task: options.watchTask === false ? undefined : this.tasks.watch(task),
|
|
53
56
|
webSocket: options.webSocket,
|
|
54
57
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -20,13 +20,15 @@ export { ArtifactsAPI } from './api/artifacts';
|
|
|
20
20
|
export { TeamsAPI, type MeResponse } from './api/teams';
|
|
21
21
|
export { SecretsAPI } from './api/secrets';
|
|
22
22
|
export { ApiKeysAPI } from './api/api-keys';
|
|
23
|
-
export {
|
|
23
|
+
export { CredentialsAPI } from './api/credentials';
|
|
24
|
+
/** @deprecated renamed CredentialsAPI */
|
|
25
|
+
export { CredentialsAPI as IntegrationsAPI } from './api/credentials';
|
|
24
26
|
export { SearchAPI } from './api/search';
|
|
25
27
|
export { ProjectsAPI } from './api/projects';
|
|
26
28
|
export { MCPServersAPI } from './api/mcp-servers';
|
|
27
|
-
export { LiveSession } from './live/session';
|
|
29
|
+
export { LiveSession, accessUrl } from './live/session';
|
|
28
30
|
export type { LiveState, LiveEnd, LiveHandlers, LiveSessionOptions, WebSocketLike, WebSocketConstructor } from './live/session';
|
|
29
|
-
export { STREAM_FORMAT, isLiveField, parseMediaType, pcmFormat, splitLiveSchema, binaryLiveField, alternativeLabel, } from './live/schema';
|
|
31
|
+
export { STREAM_FORMAT, CLEAR_KEY, isLiveField, parseMediaType, pcmFormat, splitLiveSchema, binaryLiveField, alternativeLabel, } from './live/schema';
|
|
30
32
|
export type { JsonSchema, MediaType, PCMFormat, LiveField } from './live/schema';
|
|
31
33
|
export { tool, appTool, agentTool, webhookTool, httpTool, callTool, mcpTool, internalTools, string, number, integer, boolean, enumOf, object, array, optional, } from './tool-builder';
|
|
32
34
|
export type { ClientTool, ClientToolHandler } from './tool-builder';
|
|
@@ -56,7 +58,7 @@ import { ArtifactsAPI } from './api/artifacts';
|
|
|
56
58
|
import { TeamsAPI } from './api/teams';
|
|
57
59
|
import { SecretsAPI } from './api/secrets';
|
|
58
60
|
import { ApiKeysAPI } from './api/api-keys';
|
|
59
|
-
import {
|
|
61
|
+
import { CredentialsAPI } from './api/credentials';
|
|
60
62
|
import { SearchAPI } from './api/search';
|
|
61
63
|
import { ProjectsAPI } from './api/projects';
|
|
62
64
|
import { MCPServersAPI } from './api/mcp-servers';
|
|
@@ -112,11 +114,13 @@ export declare class Inference {
|
|
|
112
114
|
readonly teams: TeamsAPI;
|
|
113
115
|
readonly secrets: SecretsAPI;
|
|
114
116
|
readonly apiKeys: ApiKeysAPI;
|
|
115
|
-
readonly
|
|
117
|
+
readonly credentials: CredentialsAPI;
|
|
116
118
|
readonly search: SearchAPI;
|
|
117
119
|
readonly projects: ProjectsAPI;
|
|
118
120
|
readonly mcpServers: MCPServersAPI;
|
|
119
121
|
readonly sockets: SocketsAPI;
|
|
122
|
+
/** @deprecated renamed `credentials` */
|
|
123
|
+
get integrations(): CredentialsAPI;
|
|
120
124
|
constructor(config: InferenceConfig | HttpClientConfig);
|
|
121
125
|
/** @internal */
|
|
122
126
|
_request<T>(method: 'get' | 'post' | 'put' | 'delete', endpoint: string, options?: {
|
package/dist/index.js
CHANGED
|
@@ -22,13 +22,15 @@ export { ArtifactsAPI } from './api/artifacts';
|
|
|
22
22
|
export { TeamsAPI } from './api/teams';
|
|
23
23
|
export { SecretsAPI } from './api/secrets';
|
|
24
24
|
export { ApiKeysAPI } from './api/api-keys';
|
|
25
|
-
export {
|
|
25
|
+
export { CredentialsAPI } from './api/credentials';
|
|
26
|
+
/** @deprecated renamed CredentialsAPI */
|
|
27
|
+
export { CredentialsAPI as IntegrationsAPI } from './api/credentials';
|
|
26
28
|
export { SearchAPI } from './api/search';
|
|
27
29
|
export { ProjectsAPI } from './api/projects';
|
|
28
30
|
export { MCPServersAPI } from './api/mcp-servers';
|
|
29
31
|
// Live: the socket of a stream task and the live fields of its schemas
|
|
30
|
-
export { LiveSession } from './live/session';
|
|
31
|
-
export { STREAM_FORMAT, isLiveField, parseMediaType, pcmFormat, splitLiveSchema, binaryLiveField, alternativeLabel, } from './live/schema';
|
|
32
|
+
export { LiveSession, accessUrl } from './live/session';
|
|
33
|
+
export { STREAM_FORMAT, CLEAR_KEY, isLiveField, parseMediaType, pcmFormat, splitLiveSchema, binaryLiveField, alternativeLabel, } from './live/schema';
|
|
32
34
|
// Tool Builder (fluent API)
|
|
33
35
|
export { tool, appTool, agentTool, webhookTool, httpTool, callTool, mcpTool, internalTools, string, number, integer, boolean, enumOf, object, array, optional, } from './tool-builder';
|
|
34
36
|
// Hook Builder (fluent API)
|
|
@@ -58,7 +60,7 @@ import { ArtifactsAPI } from './api/artifacts';
|
|
|
58
60
|
import { TeamsAPI } from './api/teams';
|
|
59
61
|
import { SecretsAPI } from './api/secrets';
|
|
60
62
|
import { ApiKeysAPI } from './api/api-keys';
|
|
61
|
-
import {
|
|
63
|
+
import { CredentialsAPI } from './api/credentials';
|
|
62
64
|
import { SearchAPI } from './api/search';
|
|
63
65
|
import { ProjectsAPI } from './api/projects';
|
|
64
66
|
import { MCPServersAPI } from './api/mcp-servers';
|
|
@@ -72,6 +74,10 @@ import { MCPServersAPI } from './api/mcp-servers';
|
|
|
72
74
|
* ```
|
|
73
75
|
*/
|
|
74
76
|
export class Inference {
|
|
77
|
+
/** @deprecated renamed `credentials` */
|
|
78
|
+
get integrations() {
|
|
79
|
+
return this.credentials;
|
|
80
|
+
}
|
|
75
81
|
constructor(config) {
|
|
76
82
|
// Handle both simple config and full HttpClientConfig
|
|
77
83
|
this.http = new HttpClient({
|
|
@@ -101,7 +107,7 @@ export class Inference {
|
|
|
101
107
|
this.teams = new TeamsAPI(this.http);
|
|
102
108
|
this.secrets = new SecretsAPI(this.http);
|
|
103
109
|
this.apiKeys = new ApiKeysAPI(this.http);
|
|
104
|
-
this.
|
|
110
|
+
this.credentials = new CredentialsAPI(this.http);
|
|
105
111
|
this.search = new SearchAPI(this.http);
|
|
106
112
|
this.projects = new ProjectsAPI(this.http);
|
|
107
113
|
this.mcpServers = new MCPServersAPI(this.http);
|
package/dist/live/schema.d.ts
CHANGED
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
* JSON Schema type keeps it.
|
|
18
18
|
*/
|
|
19
19
|
export declare const STREAM_FORMAT = "stream";
|
|
20
|
+
/**
|
|
21
|
+
* A control frame, `{"$clear": "audio"}`: drop what has been buffered of a
|
|
22
|
+
* live output field. Reserved keys start with `$`, which no field name can.
|
|
23
|
+
*/
|
|
24
|
+
export declare const CLEAR_KEY = "$clear";
|
|
20
25
|
/** The part of JSON Schema these helpers read. */
|
|
21
26
|
export interface JsonSchema {
|
|
22
27
|
$ref?: string;
|
package/dist/live/schema.js
CHANGED
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
* JSON Schema type keeps it.
|
|
18
18
|
*/
|
|
19
19
|
export const STREAM_FORMAT = 'stream';
|
|
20
|
+
/**
|
|
21
|
+
* A control frame, `{"$clear": "audio"}`: drop what has been buffered of a
|
|
22
|
+
* live output field. Reserved keys start with `$`, which no field name can.
|
|
23
|
+
*/
|
|
24
|
+
export const CLEAR_KEY = '$clear';
|
|
20
25
|
export function isLiveField(schema) {
|
|
21
26
|
return !!schema && schema.format === STREAM_FORMAT;
|
|
22
27
|
}
|
|
@@ -46,7 +51,10 @@ export function pcmFormat(media) {
|
|
|
46
51
|
return null;
|
|
47
52
|
return { sampleRate, channels };
|
|
48
53
|
}
|
|
49
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* Resolves a `#/$defs/` reference against the root, recursively. The result
|
|
56
|
+
* carries no top-level `$ref` (a validator ignores a `$ref`'s siblings).
|
|
57
|
+
*/
|
|
50
58
|
function deref(schema, root) {
|
|
51
59
|
if (!schema.$ref || !root.$defs)
|
|
52
60
|
return schema;
|
|
@@ -55,14 +63,17 @@ function deref(schema, root) {
|
|
|
55
63
|
if (!target)
|
|
56
64
|
return schema;
|
|
57
65
|
// The reference's own fields (title, description) win over the target's.
|
|
58
|
-
|
|
66
|
+
const { $ref: _ref, ...own } = schema;
|
|
67
|
+
return { ...deref(target, root), ...own };
|
|
59
68
|
}
|
|
60
69
|
function itemAlternatives(items, root) {
|
|
61
70
|
const resolved = deref(items, root);
|
|
62
71
|
const options = (resolved.anyOf ?? resolved.oneOf);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
const alternatives = options?.length ? options.map((option) => deref(option, root)) : [resolved];
|
|
73
|
+
// Each alternative must stand on its own (a form validates it without the
|
|
74
|
+
// root), and nested references (an enum field, a nested model) still point
|
|
75
|
+
// into the root's $defs, so they travel with it.
|
|
76
|
+
return root.$defs ? alternatives.map((alternative) => ({ ...alternative, $defs: root.$defs })) : alternatives;
|
|
66
77
|
}
|
|
67
78
|
/**
|
|
68
79
|
* Splits a function schema into what a form renders (the ordinary
|
package/dist/live/session.d.ts
CHANGED
|
@@ -27,6 +27,12 @@ export interface LiveHandlers {
|
|
|
27
27
|
onBinary?: (data: ArrayBuffer) => void;
|
|
28
28
|
/** A partial output object keyed by field name. */
|
|
29
29
|
onPatch?: (patch: Record<string, unknown>) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Drop what you have buffered of this live output field: the app sends it
|
|
32
|
+
* when an answer is cut short, e.g. the user talked over it. Without this
|
|
33
|
+
* handler the control frame reaches onPatch as `{"$clear": field}`.
|
|
34
|
+
*/
|
|
35
|
+
onClear?: (field: string) => void;
|
|
30
36
|
}
|
|
31
37
|
/**
|
|
32
38
|
* Follows the task the socket belongs to. `done` settles when the task ends
|
|
@@ -67,6 +73,11 @@ export interface LiveSessionOptions {
|
|
|
67
73
|
/** The WebSocket to dial with; defaults to the runtime's global one. */
|
|
68
74
|
webSocket?: WebSocketConstructor;
|
|
69
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Where to dial. A browser cannot set headers on a WebSocket, so the
|
|
78
|
+
* credential rides in the query, as the relay documents.
|
|
79
|
+
*/
|
|
80
|
+
export declare function accessUrl(access: Pick<SocketAccess, 'url' | 'token'>): string;
|
|
70
81
|
export declare class LiveSession {
|
|
71
82
|
private ws;
|
|
72
83
|
private current;
|
package/dist/live/session.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CLEAR_KEY } from './schema';
|
|
1
2
|
const WS_OPEN = 1;
|
|
2
3
|
// 1012: the relay is restarting and closed an end that still waited for its
|
|
3
4
|
// peer. 1013: the peer did not come in time. Both mean "dial again" while the
|
|
@@ -11,6 +12,14 @@ function globalWebSocket() {
|
|
|
11
12
|
}
|
|
12
13
|
return ctor;
|
|
13
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Where to dial. A browser cannot set headers on a WebSocket, so the
|
|
17
|
+
* credential rides in the query, as the relay documents.
|
|
18
|
+
*/
|
|
19
|
+
export function accessUrl(access) {
|
|
20
|
+
const sep = access.url.includes('?') ? '&' : '?';
|
|
21
|
+
return `${access.url}${sep}access_token=${encodeURIComponent(access.token)}`;
|
|
22
|
+
}
|
|
14
23
|
export class LiveSession {
|
|
15
24
|
constructor(options) {
|
|
16
25
|
this.ws = null;
|
|
@@ -37,9 +46,7 @@ export class LiveSession {
|
|
|
37
46
|
connect() {
|
|
38
47
|
this.setState('connecting');
|
|
39
48
|
this.watchTask();
|
|
40
|
-
|
|
41
|
-
// the query, as the relay documents.
|
|
42
|
-
const ws = new this.WebSocket(`${this.access.url}?access_token=${encodeURIComponent(this.access.token)}`);
|
|
49
|
+
const ws = new this.WebSocket(accessUrl(this.access));
|
|
43
50
|
ws.binaryType = 'arraybuffer';
|
|
44
51
|
this.ws = ws;
|
|
45
52
|
ws.onopen = () => this.setState('waiting');
|
|
@@ -57,7 +64,15 @@ export class LiveSession {
|
|
|
57
64
|
patch = { text: event.data };
|
|
58
65
|
}
|
|
59
66
|
if (patch && typeof patch === 'object' && !Array.isArray(patch)) {
|
|
60
|
-
|
|
67
|
+
const record = patch;
|
|
68
|
+
const clear = record[CLEAR_KEY];
|
|
69
|
+
if (this.handlers.onClear && typeof clear === 'string') {
|
|
70
|
+
this.handlers.onClear(clear);
|
|
71
|
+
delete record[CLEAR_KEY];
|
|
72
|
+
if (Object.keys(record).length === 0)
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this.handlers.onPatch?.(record);
|
|
61
76
|
}
|
|
62
77
|
}
|
|
63
78
|
else {
|
package/dist/tool-builder.d.ts
CHANGED
|
@@ -86,9 +86,16 @@ declare class HTTPToolBuilder extends ToolBuilder {
|
|
|
86
86
|
private headerMap;
|
|
87
87
|
constructor(name: string, url: string);
|
|
88
88
|
method(m: string): this;
|
|
89
|
+
/**
|
|
90
|
+
* How the tool authenticates: `credential` sends a connected account's
|
|
91
|
+
* access token (pick the account with `credentialId`), `apiKey` / `bearer`
|
|
92
|
+
* send a vault secret.
|
|
93
|
+
*/
|
|
89
94
|
auth(config: {
|
|
90
|
-
|
|
91
|
-
|
|
95
|
+
credential?: string;
|
|
96
|
+
credentialId?: string;
|
|
97
|
+
/** @deprecated renamed `credential` */ integration?: string;
|
|
98
|
+
/** @deprecated renamed `credentialId` */ integrationId?: string;
|
|
92
99
|
apiKey?: string;
|
|
93
100
|
bearer?: string;
|
|
94
101
|
header?: string;
|
|
@@ -109,11 +116,12 @@ export declare const httpTool: (name: string, url: string) => HTTPToolBuilder;
|
|
|
109
116
|
/** Create a call tool — makes authenticated HTTP requests. Preferred name for httpTool. */
|
|
110
117
|
export declare const callTool: (name: string, url: string) => HTTPToolBuilder;
|
|
111
118
|
/** Create an MCP connector tool (calls a tool on a connected MCP server) */
|
|
112
|
-
|
|
119
|
+
/** `credentialId` is the MCP credential the tool runs through. */
|
|
120
|
+
export declare const mcpTool: (name: string, credentialId: string, toolName: string) => MCPToolBuilder;
|
|
113
121
|
declare class MCPToolBuilder extends ToolBuilder {
|
|
114
|
-
private
|
|
122
|
+
private credentialId;
|
|
115
123
|
private toolName;
|
|
116
|
-
constructor(name: string,
|
|
124
|
+
constructor(name: string, credentialId: string, toolName: string);
|
|
117
125
|
build(): AgentTool;
|
|
118
126
|
}
|
|
119
127
|
declare class InternalToolsBuilder {
|
|
@@ -128,6 +136,8 @@ declare class InternalToolsBuilder {
|
|
|
128
136
|
finish(enabled?: boolean): this;
|
|
129
137
|
/** Enable meta tools */
|
|
130
138
|
meta(enabled?: boolean): this;
|
|
139
|
+
/** Enable remote tools (run commands on the user's connected remotes) */
|
|
140
|
+
remote(enabled?: boolean): this;
|
|
131
141
|
/** Enable all internal tools */
|
|
132
142
|
all(): this;
|
|
133
143
|
/** Disable all internal tools */
|
package/dist/tool-builder.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tool Builder - Fluent API for defining agent tools
|
|
3
3
|
*/
|
|
4
|
-
import { ToolTypeClient, ToolTypeApp, ToolTypeAgent, ToolTypeHook, ToolTypeHTTP, ToolTypeMCP } from './types';
|
|
4
|
+
import { ToolAuthTypeAPIKey, ToolAuthTypeBearer, ToolAuthTypeCredential, ToolTypeClient, ToolTypeApp, ToolTypeAgent, ToolTypeHook, ToolTypeHTTP, ToolTypeMCP } from './types';
|
|
5
5
|
// =============================================================================
|
|
6
6
|
// Schema Builders
|
|
7
7
|
// =============================================================================
|
|
@@ -183,15 +183,21 @@ class HTTPToolBuilder extends ToolBuilder {
|
|
|
183
183
|
this.httpMethod = m;
|
|
184
184
|
return this;
|
|
185
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* How the tool authenticates: `credential` sends a connected account's
|
|
188
|
+
* access token (pick the account with `credentialId`), `apiKey` / `bearer`
|
|
189
|
+
* send a vault secret.
|
|
190
|
+
*/
|
|
186
191
|
auth(config) {
|
|
187
|
-
|
|
188
|
-
|
|
192
|
+
const provider = config.credential ?? config.integration;
|
|
193
|
+
if (provider) {
|
|
194
|
+
this.authConfig = { type: ToolAuthTypeCredential, provider, credential_id: config.credentialId ?? config.integrationId };
|
|
189
195
|
}
|
|
190
196
|
else if (config.apiKey) {
|
|
191
|
-
this.authConfig = { type:
|
|
197
|
+
this.authConfig = { type: ToolAuthTypeAPIKey, secret: config.apiKey, header: config.header || 'X-API-Key' };
|
|
192
198
|
}
|
|
193
199
|
else if (config.bearer) {
|
|
194
|
-
this.authConfig = { type:
|
|
200
|
+
this.authConfig = { type: ToolAuthTypeBearer, secret: config.bearer };
|
|
195
201
|
}
|
|
196
202
|
return this;
|
|
197
203
|
}
|
|
@@ -232,11 +238,12 @@ export const httpTool = (name, url) => new HTTPToolBuilder(name, url);
|
|
|
232
238
|
/** Create a call tool — makes authenticated HTTP requests. Preferred name for httpTool. */
|
|
233
239
|
export const callTool = (name, url) => new HTTPToolBuilder(name, url);
|
|
234
240
|
/** Create an MCP connector tool (calls a tool on a connected MCP server) */
|
|
235
|
-
|
|
241
|
+
/** `credentialId` is the MCP credential the tool runs through. */
|
|
242
|
+
export const mcpTool = (name, credentialId, toolName) => new MCPToolBuilder(name, credentialId, toolName);
|
|
236
243
|
class MCPToolBuilder extends ToolBuilder {
|
|
237
|
-
constructor(name,
|
|
244
|
+
constructor(name, credentialId, toolName) {
|
|
238
245
|
super(name);
|
|
239
|
-
this.
|
|
246
|
+
this.credentialId = credentialId;
|
|
240
247
|
this.toolName = toolName;
|
|
241
248
|
}
|
|
242
249
|
build() {
|
|
@@ -246,7 +253,7 @@ class MCPToolBuilder extends ToolBuilder {
|
|
|
246
253
|
description: this.desc,
|
|
247
254
|
type: ToolTypeMCP,
|
|
248
255
|
require_approval: this.approval || undefined,
|
|
249
|
-
mcp: {
|
|
256
|
+
mcp: { credential_id: this.credentialId, tool_name: this.toolName },
|
|
250
257
|
};
|
|
251
258
|
}
|
|
252
259
|
}
|
|
@@ -282,6 +289,11 @@ class InternalToolsBuilder {
|
|
|
282
289
|
this.config.meta = enabled;
|
|
283
290
|
return this;
|
|
284
291
|
}
|
|
292
|
+
/** Enable remote tools (run commands on the user's connected remotes) */
|
|
293
|
+
remote(enabled = true) {
|
|
294
|
+
this.config.remote = enabled;
|
|
295
|
+
return this;
|
|
296
|
+
}
|
|
285
297
|
/** Enable all internal tools */
|
|
286
298
|
all() {
|
|
287
299
|
this.config.plan = true;
|
package/dist/types.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export interface InternalToolsConfig {
|
|
|
11
11
|
meta?: boolean;
|
|
12
12
|
artifact?: boolean;
|
|
13
13
|
spawn?: boolean;
|
|
14
|
+
remote?: boolean;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* AgentTool represents a unified tool that can be used by an agent
|
|
@@ -99,12 +100,37 @@ export interface ClientToolConfig {
|
|
|
99
100
|
input_schema?: any;
|
|
100
101
|
output_schema?: any;
|
|
101
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* ToolAuthType says how an HTTP tool authenticates.
|
|
105
|
+
*/
|
|
106
|
+
export type ToolAuthType = string;
|
|
107
|
+
/**
|
|
108
|
+
* ToolAuthTypeNone sends no credentials (same as leaving type empty).
|
|
109
|
+
*/
|
|
110
|
+
export declare const ToolAuthTypeNone: ToolAuthType;
|
|
111
|
+
/**
|
|
112
|
+
* ToolAuthTypeCredential sends a connected credential's access token.
|
|
113
|
+
*/
|
|
114
|
+
export declare const ToolAuthTypeCredential: ToolAuthType;
|
|
115
|
+
/**
|
|
116
|
+
* ToolAuthTypeAPIKey sends a vault secret in a header.
|
|
117
|
+
*/
|
|
118
|
+
export declare const ToolAuthTypeAPIKey: ToolAuthType;
|
|
119
|
+
/**
|
|
120
|
+
* ToolAuthTypeBearer sends a vault secret as a bearer token.
|
|
121
|
+
*/
|
|
122
|
+
export declare const ToolAuthTypeBearer: ToolAuthType;
|
|
102
123
|
/**
|
|
103
124
|
* ToolAuthConfig declares how a tool authenticates.
|
|
104
125
|
*/
|
|
105
126
|
export interface ToolAuthConfig {
|
|
106
|
-
type:
|
|
127
|
+
type: ToolAuthType;
|
|
107
128
|
provider?: string;
|
|
129
|
+
credential_id?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Deprecated: the credential id used to be called integration_id. Read
|
|
132
|
+
* through CredentialRef(); never written.
|
|
133
|
+
*/
|
|
108
134
|
integration_id?: string;
|
|
109
135
|
secret?: string;
|
|
110
136
|
header?: string;
|
|
@@ -120,7 +146,12 @@ export interface HTTPToolConfig {
|
|
|
120
146
|
output_schema?: any;
|
|
121
147
|
}
|
|
122
148
|
export interface MCPToolConfig {
|
|
123
|
-
|
|
149
|
+
credential_id?: string;
|
|
150
|
+
/**
|
|
151
|
+
* Deprecated: the credential id used to be called integration_id. Read
|
|
152
|
+
* through CredentialRef(); never written.
|
|
153
|
+
*/
|
|
154
|
+
integration_id?: string;
|
|
124
155
|
tool_name: string;
|
|
125
156
|
}
|
|
126
157
|
export interface AppToolConfigDTO {
|
|
@@ -160,7 +191,7 @@ export interface HTTPToolConfigDTO {
|
|
|
160
191
|
output_schema?: any;
|
|
161
192
|
}
|
|
162
193
|
export interface MCPToolConfigDTO {
|
|
163
|
-
|
|
194
|
+
credential_id: string;
|
|
164
195
|
tool_name: string;
|
|
165
196
|
}
|
|
166
197
|
/**
|
|
@@ -195,6 +226,15 @@ export interface AgentDTO extends BaseModelDTO, PermissionModelDTO, ProjectModel
|
|
|
195
226
|
images: AgentImages;
|
|
196
227
|
version_id: string;
|
|
197
228
|
version?: AgentVersionDTO;
|
|
229
|
+
/**
|
|
230
|
+
* ProfileID is set when a harness profile on a remote thinks for this
|
|
231
|
+
* agent instead of our loop.
|
|
232
|
+
*/
|
|
233
|
+
profile_id?: string;
|
|
234
|
+
/**
|
|
235
|
+
* RemoteID is the machine the agent's terminal tools run on by default.
|
|
236
|
+
*/
|
|
237
|
+
remote_id?: string;
|
|
198
238
|
}
|
|
199
239
|
export interface AgentVersionDTO extends BaseModelDTO, PermissionModelDTO {
|
|
200
240
|
description: string;
|
|
@@ -266,6 +306,12 @@ export interface AgentRunDTO extends BaseModelDTO, PermissionModelDTO {
|
|
|
266
306
|
tool_invocation_id?: string;
|
|
267
307
|
trigger_id?: string;
|
|
268
308
|
metadata?: any;
|
|
309
|
+
/**
|
|
310
|
+
* ProfileID is the harness profile that thought for this run; nil when it
|
|
311
|
+
* was our own loop. RemoteID is the machine it ran on, if any.
|
|
312
|
+
*/
|
|
313
|
+
profile_id?: string;
|
|
314
|
+
remote_id?: string;
|
|
269
315
|
}
|
|
270
316
|
export interface APIResponse<T extends any> {
|
|
271
317
|
success: boolean;
|
|
@@ -392,7 +438,7 @@ export interface AppVersionInput {
|
|
|
392
438
|
};
|
|
393
439
|
kernel?: string;
|
|
394
440
|
required_secrets?: SecretRequirement[];
|
|
395
|
-
|
|
441
|
+
required_credentials?: CredentialRequirement[];
|
|
396
442
|
resources?: AppResources;
|
|
397
443
|
}
|
|
398
444
|
/**
|
|
@@ -551,7 +597,7 @@ export interface CredentialCompleteOAuthRequest {
|
|
|
551
597
|
code_verifier?: string;
|
|
552
598
|
}
|
|
553
599
|
export interface CredentialConnectResponse {
|
|
554
|
-
|
|
600
|
+
credential?: CredentialDTO;
|
|
555
601
|
auth_url?: string;
|
|
556
602
|
state?: string;
|
|
557
603
|
code_verifier?: string;
|
|
@@ -808,15 +854,16 @@ export declare const ScopeSecretsRead: Scope;
|
|
|
808
854
|
*/
|
|
809
855
|
export declare const ScopeSecretsWrite: Scope;
|
|
810
856
|
/**
|
|
811
|
-
* Action-level scopes for
|
|
857
|
+
* Action-level scopes for credentials (connected accounts, vaults,
|
|
858
|
+
* custom providers, MCP servers). Formerly integrations:read|write.
|
|
812
859
|
*/
|
|
813
|
-
export declare const
|
|
860
|
+
export declare const ScopeCredentialsRead: Scope;
|
|
814
861
|
/**
|
|
815
862
|
* API Key Scopes - hierarchical permission system.
|
|
816
863
|
* Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
|
|
817
864
|
* Empty scopes = full access (for backwards compatibility with existing keys).
|
|
818
865
|
*/
|
|
819
|
-
export declare const
|
|
866
|
+
export declare const ScopeCredentialsWrite: Scope;
|
|
820
867
|
/**
|
|
821
868
|
* Action-level scopes for Engines
|
|
822
869
|
*/
|
|
@@ -897,7 +944,7 @@ export declare const ScopeGroupProjects: ScopeGroup;
|
|
|
897
944
|
export declare const ScopeGroupTeams: ScopeGroup;
|
|
898
945
|
export declare const ScopeGroupBilling: ScopeGroup;
|
|
899
946
|
export declare const ScopeGroupSecrets: ScopeGroup;
|
|
900
|
-
export declare const
|
|
947
|
+
export declare const ScopeGroupCredentials: ScopeGroup;
|
|
901
948
|
export declare const ScopeGroupEngines: ScopeGroup;
|
|
902
949
|
export declare const ScopeGroupApiKeys: ScopeGroup;
|
|
903
950
|
export declare const ScopeGroupKnowledge: ScopeGroup;
|
|
@@ -1046,13 +1093,28 @@ export interface SecretRequirement {
|
|
|
1046
1093
|
optional?: boolean;
|
|
1047
1094
|
}
|
|
1048
1095
|
/**
|
|
1049
|
-
* CredentialRequirement
|
|
1050
|
-
*
|
|
1051
|
-
* Secrets lists the
|
|
1052
|
-
* Scopes
|
|
1096
|
+
* CredentialRequirement is an entry under credentials: in inf.yml: keys an
|
|
1097
|
+
* app needs that belong to a provider. Provider names whose credential
|
|
1098
|
+
* supplies them; Secrets lists the keys to inject from it (an API key
|
|
1099
|
+
* credential), Scopes what to ask for (an OAuth one).
|
|
1100
|
+
* credentials:
|
|
1101
|
+
* - provider: acme
|
|
1102
|
+
* name: Acme CRM
|
|
1103
|
+
* website: acme.com
|
|
1104
|
+
* secrets: [ACME_API_KEY]
|
|
1105
|
+
* Key is a capability of a provider the platform defines ("x.tweet.read",
|
|
1106
|
+
* "google.sheets"): an OAuth grant with the scopes it implies. An entry sets
|
|
1107
|
+
* Provider, Key, or both; with both, Key decides how it is resolved.
|
|
1053
1108
|
*/
|
|
1054
1109
|
export interface CredentialRequirement {
|
|
1055
|
-
|
|
1110
|
+
provider?: string;
|
|
1111
|
+
/**
|
|
1112
|
+
* Name and Website describe a provider the platform does not list: the
|
|
1113
|
+
* name its credential is shown under and the site its logo comes from.
|
|
1114
|
+
*/
|
|
1115
|
+
name?: string;
|
|
1116
|
+
website?: string;
|
|
1117
|
+
key?: string;
|
|
1056
1118
|
description?: string;
|
|
1057
1119
|
optional?: boolean;
|
|
1058
1120
|
secrets?: string[];
|
|
@@ -1106,7 +1168,7 @@ export interface AppVersionDTO extends BaseModelDTO {
|
|
|
1106
1168
|
};
|
|
1107
1169
|
kernel: string;
|
|
1108
1170
|
required_secrets?: SecretRequirement[];
|
|
1109
|
-
|
|
1171
|
+
required_credentials?: CredentialRequirement[];
|
|
1110
1172
|
resources: AppResources;
|
|
1111
1173
|
checksum?: string;
|
|
1112
1174
|
}
|
|
@@ -1633,6 +1695,15 @@ export interface ChatDTO extends BaseModelDTO, PermissionModelDTO {
|
|
|
1633
1695
|
agent_data: ChatData;
|
|
1634
1696
|
active_run?: AgentRunDTO;
|
|
1635
1697
|
pending_interrupts?: InterruptDTO[];
|
|
1698
|
+
/**
|
|
1699
|
+
* HarnessSessionID is the harness's own session id when a remote profile
|
|
1700
|
+
* thinks for this chat; `claude --resume <id>` opens it on that machine.
|
|
1701
|
+
*/
|
|
1702
|
+
harness_session_id?: string;
|
|
1703
|
+
/**
|
|
1704
|
+
* ForkedFromMessageID is the message this chat was branched at.
|
|
1705
|
+
*/
|
|
1706
|
+
forked_from_message_id?: string;
|
|
1636
1707
|
}
|
|
1637
1708
|
/**
|
|
1638
1709
|
* ChatMessageDTO for API responses
|
|
@@ -3058,9 +3129,9 @@ export interface CompletePaymentRequest {
|
|
|
3058
3129
|
payment_id?: string;
|
|
3059
3130
|
}
|
|
3060
3131
|
/**
|
|
3061
|
-
*
|
|
3132
|
+
* UpdateCredentialScopesRequest adds OAuth scopes to a connected credential.
|
|
3062
3133
|
*/
|
|
3063
|
-
export interface
|
|
3134
|
+
export interface UpdateCredentialScopesRequest {
|
|
3064
3135
|
scopes: string[];
|
|
3065
3136
|
}
|
|
3066
3137
|
/**
|
|
@@ -3105,7 +3176,7 @@ export declare const RequirementTypeSecret: RequirementType;
|
|
|
3105
3176
|
/**
|
|
3106
3177
|
* Requirement error types
|
|
3107
3178
|
*/
|
|
3108
|
-
export declare const
|
|
3179
|
+
export declare const RequirementTypeCredential: RequirementType;
|
|
3109
3180
|
/**
|
|
3110
3181
|
* Requirement error types
|
|
3111
3182
|
*/
|
|
@@ -3137,13 +3208,23 @@ export interface SetupAction {
|
|
|
3137
3208
|
scope_descriptions?: {
|
|
3138
3209
|
[key: string]: string;
|
|
3139
3210
|
};
|
|
3211
|
+
/**
|
|
3212
|
+
* Secrets are the keys to supply for an add_secret action on a
|
|
3213
|
+
* provider: saved against Provider, they become its credential.
|
|
3214
|
+
*/
|
|
3215
|
+
secrets?: string[];
|
|
3216
|
+
/**
|
|
3217
|
+
* ProviderWebsite is where the logo of a provider the platform does not
|
|
3218
|
+
* list comes from; sent back when the keys are saved.
|
|
3219
|
+
*/
|
|
3220
|
+
provider_website?: string;
|
|
3140
3221
|
}
|
|
3141
3222
|
/**
|
|
3142
3223
|
* CheckRequirementsRequest is the request body for checking requirements
|
|
3143
3224
|
*/
|
|
3144
3225
|
export interface CheckRequirementsRequest {
|
|
3145
3226
|
secrets?: SecretRequirement[];
|
|
3146
|
-
|
|
3227
|
+
credentials?: CredentialRequirement[];
|
|
3147
3228
|
}
|
|
3148
3229
|
/**
|
|
3149
3230
|
* CheckRequirementsResponse is the API response for checking requirements
|
|
@@ -4143,7 +4224,7 @@ export declare const GraphNodeTypeApproval: GraphNodeType;
|
|
|
4143
4224
|
export declare const GraphNodeTypeConditional: GraphNodeType;
|
|
4144
4225
|
export declare const GraphNodeTypeFlowNode: GraphNodeType;
|
|
4145
4226
|
export declare const GraphNodeTypeTrigger: GraphNodeType;
|
|
4146
|
-
export declare const
|
|
4227
|
+
export declare const GraphNodeTypeCredentialRequirement: GraphNodeType;
|
|
4147
4228
|
/**
|
|
4148
4229
|
* GraphNodeStatus represents the status of a node
|
|
4149
4230
|
*/
|
package/dist/types.js
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
// Code generated by gotypegen. DO NOT EDIT.
|
|
2
|
+
/**
|
|
3
|
+
* ToolAuthTypeNone sends no credentials (same as leaving type empty).
|
|
4
|
+
*/
|
|
5
|
+
export const ToolAuthTypeNone = "none";
|
|
6
|
+
/**
|
|
7
|
+
* ToolAuthTypeCredential sends a connected credential's access token.
|
|
8
|
+
*/
|
|
9
|
+
export const ToolAuthTypeCredential = "credential";
|
|
10
|
+
/**
|
|
11
|
+
* ToolAuthTypeAPIKey sends a vault secret in a header.
|
|
12
|
+
*/
|
|
13
|
+
export const ToolAuthTypeAPIKey = "api_key";
|
|
14
|
+
/**
|
|
15
|
+
* ToolAuthTypeBearer sends a vault secret as a bearer token.
|
|
16
|
+
*/
|
|
17
|
+
export const ToolAuthTypeBearer = "bearer";
|
|
2
18
|
/**
|
|
3
19
|
* API Key Scopes - hierarchical permission system.
|
|
4
20
|
* Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
|
|
@@ -182,15 +198,16 @@ export const ScopeSecretsRead = "secrets:read";
|
|
|
182
198
|
*/
|
|
183
199
|
export const ScopeSecretsWrite = "secrets:write";
|
|
184
200
|
/**
|
|
185
|
-
* Action-level scopes for
|
|
201
|
+
* Action-level scopes for credentials (connected accounts, vaults,
|
|
202
|
+
* custom providers, MCP servers). Formerly integrations:read|write.
|
|
186
203
|
*/
|
|
187
|
-
export const
|
|
204
|
+
export const ScopeCredentialsRead = "credentials:read";
|
|
188
205
|
/**
|
|
189
206
|
* API Key Scopes - hierarchical permission system.
|
|
190
207
|
* Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
|
|
191
208
|
* Empty scopes = full access (for backwards compatibility with existing keys).
|
|
192
209
|
*/
|
|
193
|
-
export const
|
|
210
|
+
export const ScopeCredentialsWrite = "credentials:write";
|
|
194
211
|
/**
|
|
195
212
|
* Action-level scopes for Engines
|
|
196
213
|
*/
|
|
@@ -267,7 +284,7 @@ export const ScopeGroupProjects = "projects";
|
|
|
267
284
|
export const ScopeGroupTeams = "teams";
|
|
268
285
|
export const ScopeGroupBilling = "billing";
|
|
269
286
|
export const ScopeGroupSecrets = "secrets";
|
|
270
|
-
export const
|
|
287
|
+
export const ScopeGroupCredentials = "credentials";
|
|
271
288
|
export const ScopeGroupEngines = "engines";
|
|
272
289
|
export const ScopeGroupApiKeys = "apikeys";
|
|
273
290
|
export const ScopeGroupKnowledge = "knowledge";
|
|
@@ -383,7 +400,7 @@ export const RequirementTypeSecret = "secret";
|
|
|
383
400
|
/**
|
|
384
401
|
* Requirement error types
|
|
385
402
|
*/
|
|
386
|
-
export const
|
|
403
|
+
export const RequirementTypeCredential = "credential";
|
|
387
404
|
/**
|
|
388
405
|
* Requirement error types
|
|
389
406
|
*/
|
|
@@ -537,7 +554,7 @@ export const GraphNodeTypeApproval = "approval";
|
|
|
537
554
|
export const GraphNodeTypeConditional = "conditional";
|
|
538
555
|
export const GraphNodeTypeFlowNode = "flow_node";
|
|
539
556
|
export const GraphNodeTypeTrigger = "trigger";
|
|
540
|
-
export const
|
|
557
|
+
export const GraphNodeTypeCredentialRequirement = "credential_requirement";
|
|
541
558
|
export const GraphNodeStatusPending = "pending";
|
|
542
559
|
export const GraphNodeStatusReady = "ready";
|
|
543
560
|
export const GraphNodeStatusRunning = "running";
|