@inferencesh/sdk 0.29.1 → 0.30.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/CHANGELOG.md +5 -0
- package/README.md +2 -2
- package/dist/tool-builder.d.ts +6 -16
- package/dist/tool-builder.js +7 -16
- package/dist/types.d.ts +2 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.30.0] - 2026-10-18
|
|
11
|
+
|
|
12
|
+
### Removed
|
|
13
|
+
- `credentialId` on `httpTool().auth()` and `mcpTool()`, and the positional `mcpTool(name, credentialId, toolName)`: a tool no longer pins a connection. Credential-auth HTTP tools and MCP tools always sign in with the caller's own login to the provider at run time; `mcpTool(name, { server, toolName })` requires `server` (INF-1012). Generated types: `ToolAuthConfig`, `MCPToolConfig` and `MCPToolConfigDTO` lose `credential_id`.
|
|
14
|
+
|
|
10
15
|
## [0.29.0] - 2026-10-17
|
|
11
16
|
|
|
12
17
|
### Removed
|
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, { server, toolName
|
|
380
|
+
| `mcpTool(name, { server, toolName })` | Server | Call a tool on an MCP server (by slug), signed in with the runner's own connection to the server's provider |
|
|
381
381
|
| `internalTools()` | Server | Built-in tools: plan, memory, widget, finish, skills, meta, remote, knowledge, artifact, agent |
|
|
382
382
|
|
|
383
383
|
```typescript
|
|
@@ -401,7 +401,7 @@ const clientTool = tool('get_weather')
|
|
|
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({ credential: CredentialProviderGoogle
|
|
404
|
+
.auth({ credential: CredentialProviderGoogle })
|
|
405
405
|
.build();
|
|
406
406
|
|
|
407
407
|
// API key or bearer auth
|
package/dist/tool-builder.d.ts
CHANGED
|
@@ -100,13 +100,12 @@ declare class HTTPToolBuilder extends ToolBuilder {
|
|
|
100
100
|
constructor(name: string, url: string);
|
|
101
101
|
method(m: string): this;
|
|
102
102
|
/**
|
|
103
|
-
* How the tool authenticates: `credential` sends
|
|
104
|
-
*
|
|
105
|
-
*
|
|
103
|
+
* How the tool authenticates: `credential` sends the access token of the
|
|
104
|
+
* runner's own connection to that provider, `apiKey` / `bearer` send a
|
|
105
|
+
* vault secret.
|
|
106
106
|
*/
|
|
107
107
|
auth(config: {
|
|
108
108
|
credential?: string;
|
|
109
|
-
credentialId?: string;
|
|
110
109
|
apiKey?: string;
|
|
111
110
|
bearer?: string;
|
|
112
111
|
header?: string;
|
|
@@ -131,24 +130,15 @@ export interface MCPToolTarget {
|
|
|
131
130
|
/** The MCP server's slug (a workspace registration or a directory entry). */
|
|
132
131
|
server: string;
|
|
133
132
|
toolName: string;
|
|
134
|
-
/** Pins one connection to the server's provider; by default the runner's own is used. */
|
|
135
|
-
credentialId?: string;
|
|
136
133
|
}
|
|
137
134
|
/**
|
|
138
135
|
* Create an MCP tool: `toolName` on the MCP server `target.server` (its slug).
|
|
139
|
-
* The call signs in with the runner's connection to the server's provider
|
|
140
|
-
* `credentialId` pins one connection instead.
|
|
141
|
-
*
|
|
142
|
-
* The older form `mcpTool(name, credentialId, toolName)` (a string second
|
|
143
|
-
* argument) still works: a tool naming only a connection is saved with the
|
|
144
|
-
* server that connection's provider is declared by.
|
|
136
|
+
* The call signs in with the runner's own connection to the server's provider.
|
|
145
137
|
*/
|
|
146
|
-
export declare function mcpTool(name: string, target: MCPToolTarget
|
|
138
|
+
export declare function mcpTool(name: string, target: MCPToolTarget): MCPToolBuilder;
|
|
147
139
|
declare class MCPToolBuilder extends ToolBuilder {
|
|
148
140
|
private target;
|
|
149
|
-
constructor(name: string, target:
|
|
150
|
-
toolName: string;
|
|
151
|
-
});
|
|
141
|
+
constructor(name: string, target: MCPToolTarget);
|
|
152
142
|
build(): AgentTool;
|
|
153
143
|
}
|
|
154
144
|
declare class InternalToolsBuilder {
|
package/dist/tool-builder.js
CHANGED
|
@@ -184,13 +184,13 @@ class HTTPToolBuilder extends ToolBuilder {
|
|
|
184
184
|
return this;
|
|
185
185
|
}
|
|
186
186
|
/**
|
|
187
|
-
* How the tool authenticates: `credential` sends
|
|
188
|
-
*
|
|
189
|
-
*
|
|
187
|
+
* How the tool authenticates: `credential` sends the access token of the
|
|
188
|
+
* runner's own connection to that provider, `apiKey` / `bearer` send a
|
|
189
|
+
* vault secret.
|
|
190
190
|
*/
|
|
191
191
|
auth(config) {
|
|
192
192
|
if (config.credential) {
|
|
193
|
-
this.authConfig = { type: ToolAuthTypeCredential, provider: config.credential
|
|
193
|
+
this.authConfig = { type: ToolAuthTypeCredential, provider: config.credential };
|
|
194
194
|
}
|
|
195
195
|
else if (config.apiKey) {
|
|
196
196
|
this.authConfig = { type: ToolAuthTypeAPIKey, secret: config.apiKey, header: config.header || 'X-API-Key' };
|
|
@@ -238,17 +238,9 @@ export const httpTool = (name, url) => new HTTPToolBuilder(name, url);
|
|
|
238
238
|
export const callTool = (name, url) => new HTTPToolBuilder(name, url);
|
|
239
239
|
/**
|
|
240
240
|
* Create an MCP tool: `toolName` on the MCP server `target.server` (its slug).
|
|
241
|
-
* The call signs in with the runner's connection to the server's provider
|
|
242
|
-
* `credentialId` pins one connection instead.
|
|
243
|
-
*
|
|
244
|
-
* The older form `mcpTool(name, credentialId, toolName)` (a string second
|
|
245
|
-
* argument) still works: a tool naming only a connection is saved with the
|
|
246
|
-
* server that connection's provider is declared by.
|
|
241
|
+
* The call signs in with the runner's own connection to the server's provider.
|
|
247
242
|
*/
|
|
248
|
-
export function mcpTool(name, target
|
|
249
|
-
if (typeof target === 'string') {
|
|
250
|
-
return new MCPToolBuilder(name, { toolName: toolName ?? '', credentialId: target });
|
|
251
|
-
}
|
|
243
|
+
export function mcpTool(name, target) {
|
|
252
244
|
return new MCPToolBuilder(name, target);
|
|
253
245
|
}
|
|
254
246
|
class MCPToolBuilder extends ToolBuilder {
|
|
@@ -264,9 +256,8 @@ class MCPToolBuilder extends ToolBuilder {
|
|
|
264
256
|
type: ToolTypeMCP,
|
|
265
257
|
require_approval: this.approval || undefined,
|
|
266
258
|
mcp: {
|
|
259
|
+
server: this.target.server,
|
|
267
260
|
tool_name: this.target.toolName,
|
|
268
|
-
...(this.target.server ? { server: this.target.server } : {}),
|
|
269
|
-
...(this.target.credentialId ? { credential_id: this.target.credentialId } : {}),
|
|
270
261
|
},
|
|
271
262
|
};
|
|
272
263
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -172,7 +172,6 @@ export declare const ToolAuthTypeBearer: ToolAuthType;
|
|
|
172
172
|
export interface ToolAuthConfig {
|
|
173
173
|
type: ToolAuthType;
|
|
174
174
|
provider?: string;
|
|
175
|
-
credential_id?: string;
|
|
176
175
|
secret?: string;
|
|
177
176
|
header?: string;
|
|
178
177
|
}
|
|
@@ -203,15 +202,12 @@ export interface HTTPToolConfig {
|
|
|
203
202
|
/**
|
|
204
203
|
* MCPToolConfig is a tool of an MCP server: the server by its slug (the
|
|
205
204
|
* agent's team's registration, its org's or the directory's) and the tool
|
|
206
|
-
* to call.
|
|
207
|
-
*
|
|
208
|
-
* written with only a connection is saved with the server that
|
|
209
|
-
* connection's provider is declared by.
|
|
205
|
+
* to call. Each call signs in with the runner's connection to the
|
|
206
|
+
* server's provider (Credential.ToolConnection).
|
|
210
207
|
*/
|
|
211
208
|
export interface MCPToolConfig {
|
|
212
209
|
server?: string;
|
|
213
210
|
tool_name: string;
|
|
214
|
-
credential_id?: string;
|
|
215
211
|
}
|
|
216
212
|
export interface AppToolConfigDTO {
|
|
217
213
|
ref: string;
|
|
@@ -264,7 +260,6 @@ export interface HTTPToolConfigDTO {
|
|
|
264
260
|
export interface MCPToolConfigDTO {
|
|
265
261
|
server: string;
|
|
266
262
|
tool_name: string;
|
|
267
|
-
credential_id?: string;
|
|
268
263
|
}
|
|
269
264
|
/**
|
|
270
265
|
* CoreAppConfigDTO references an app used as the agent's core
|