@inferencesh/sdk 0.26.1 → 0.27.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 +19 -0
- package/README.md +5 -4
- package/dist/agent/types.d.ts +3 -13
- package/dist/api/agents.js +5 -9
- package/dist/api/write-bodies.d.ts +8 -7
- package/dist/index.d.ts +1 -1
- package/dist/tool-builder.d.ts +37 -8
- package/dist/tool-builder.js +22 -7
- package/dist/types.d.ts +67 -11
- package/dist/types.js +0 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.27.0] - 2026-10-13
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- `client.agent(...).sendMessage(text, { files })` sends the files as `MessageInput.attachments` (FileRefs with filename and content type) instead of the deprecated `images` / `files` URI lists.
|
|
15
|
+
- A `tool(...).handler()` handler may return `{ result, attachments }` (`ClientToolResult`, now exported from the package root) like a `clientToolHandlers` handler: the result text plus files uploaded with `client.files.upload`.
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Generated types follow the API: `MCPServerDTO.connection` (`ConnectionInfo` with `MCPConnectionFacts`); `connection_status` is deprecated.
|
|
20
|
+
|
|
21
|
+
## [0.26.2] - 2026-10-13
|
|
22
|
+
|
|
23
|
+
Added: `mcpTool(name, { server, toolName, credentialId? })` names the MCP server by its slug (the API's model: a server declares the provider it signs in through); `credentialId` pins one connection. The old `mcpTool(name, credentialId, toolName)` still works (deprecated): the API saves such a tool with the server the connection's provider is declared by. `MCPServerUpdateBody` gains `credentials`; its `auth_type`, `oauth_client_id` and `oauth_secret_key` are no longer read by the API (the provider's OAuth app is set through `PUT /credentials/{slug}/app`). Generated types: `MCPToolConfig.server`; `MCPServerDTO.oauth_client_id`, `CredentialProviderMCP` and `CredentialTypeMCP` are gone from the API.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- Generated types follow the API: `MCPToolConfig` is `{ server, tool_name, credential_id? }`; `MCPServerDTO` loses `oauth_client_id`; `CredentialProviderMCP` and `CredentialTypeMCP` are gone (a credential of an MCP provider has type `oauth` or `api_key` and the provider slug the server declares in `credential_slug`).
|
|
28
|
+
|
|
10
29
|
## [0.26.1] - 2026-10-12
|
|
11
30
|
|
|
12
31
|
### 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, { server, toolName, credentialId? })` | Server | Call a tool on an MCP server (by slug), signed in through the server's provider; `credentialId` pins one connection. `mcpTool(name, credentialId, toolName)` still works and is saved with the connection's server |
|
|
381
381
|
| `internalTools()` | Server | Built-in tools: plan, memory, widget, finish, skills, meta, remote, knowledge, artifact, agent |
|
|
382
382
|
|
|
383
383
|
```typescript
|
|
@@ -420,7 +420,8 @@ const imageGen = appTool('generate_image', 'infsh/flux-schnell@abc123')
|
|
|
420
420
|
.requireApproval()
|
|
421
421
|
.build();
|
|
422
422
|
|
|
423
|
-
|
|
423
|
+
// MCP server by slug; the runner's connection to its provider signs the call
|
|
424
|
+
const mcpSearch = mcpTool('notion_search', { server: 'notion', toolName: 'search' })
|
|
424
425
|
.describe('Search Notion pages')
|
|
425
426
|
.param('query', string('Search query'))
|
|
426
427
|
.build();
|
|
@@ -689,8 +690,8 @@ try {
|
|
|
689
690
|
|
|
690
691
|
| Constant group | Values |
|
|
691
692
|
|----------------|--------|
|
|
692
|
-
| `CredentialProvider*` | `google`, `slack`, `notion`, `github`, `x`, `microsoft`, `salesforce`, `discord`, `gcp`, `
|
|
693
|
-
| `CredentialType*` | `service_account`, `oauth`, `api_key`, `wif
|
|
693
|
+
| `CredentialProvider*` | `google`, `google-sa`, `slack`, `notion`, `github`, `x`, `microsoft`, `salesforce`, `discord`, `gcp`, `reddit` |
|
|
694
|
+
| `CredentialType*` | `service_account`, `oauth`, `api_key`, `wif` |
|
|
694
695
|
| `CredentialStatus*` | `connected`, `disconnected`, `expired`, `error` |
|
|
695
696
|
|
|
696
697
|
## Instance Status Constants
|
package/dist/agent/types.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import type { Dispatch } from 'react';
|
|
7
7
|
import type { AgentRunDTO, AgentVersionDTO, AlwaysAllowOptionsDTO, AlwaysAllowResultDTO, ToolExplanationDTO, ChatAgentDTO, ChatDTO, ChatMessageDTO, ChatSettingsDTO, ChatSettingsRequest, AgentTool, AgentConfigInput as GeneratedAgentConfig, CoreAppConfigInput as CoreAppConfig, FileRef, ElicitResult } from '../types.js';
|
|
8
8
|
import type { HttpClient } from '../http/client.js';
|
|
9
|
+
import type { ClientToolResult } from '../tool-builder.js';
|
|
9
10
|
import type { StreamableManager } from '../http/streamable.js';
|
|
10
11
|
import type { PollManager } from '../http/poll.js';
|
|
11
12
|
export type { FileRef } from '../types.js';
|
|
@@ -221,19 +222,8 @@ export interface AgentChatProviderProps {
|
|
|
221
222
|
/** Children */
|
|
222
223
|
children: React.ReactNode;
|
|
223
224
|
}
|
|
224
|
-
/**
|
|
225
|
-
|
|
226
|
-
*
|
|
227
|
-
* `attachments` are files already uploaded with POST /files (for example with
|
|
228
|
-
* `client.files.upload(dataUrlOrBlob)` or the chat's `uploadFile`), passed as
|
|
229
|
-
* `FileRef`s, the same as message attachments. An image attachment reaches the
|
|
230
|
-
* model as image input when the model supports images; other files are listed
|
|
231
|
-
* on the tool message.
|
|
232
|
-
*/
|
|
233
|
-
export type ClientToolResult = string | {
|
|
234
|
-
result: string;
|
|
235
|
-
attachments?: FileRef[];
|
|
236
|
-
};
|
|
225
|
+
/** What a client tool handler returns (defined with the tool builder). */
|
|
226
|
+
export type { ClientToolResult } from '../tool-builder.js';
|
|
237
227
|
/**
|
|
238
228
|
* Client tool handler function - takes args and returns a result (sync or async)
|
|
239
229
|
*/
|
package/dist/api/agents.js
CHANGED
|
@@ -63,8 +63,7 @@ export class Agent {
|
|
|
63
63
|
const isTemplate = typeof this.config === 'string';
|
|
64
64
|
const hasCallbacks = !!(options.onMessage || options.onChat || options.onToolCall || options.onDelta);
|
|
65
65
|
// Process files - either already uploaded (FileDTO with uri) or needs upload (Blob)
|
|
66
|
-
let
|
|
67
|
-
let fileUris;
|
|
66
|
+
let attachments;
|
|
68
67
|
if (options.files && options.files.length > 0) {
|
|
69
68
|
const toUpload = [];
|
|
70
69
|
const alreadyUploaded = [];
|
|
@@ -78,14 +77,11 @@ export class Agent {
|
|
|
78
77
|
}
|
|
79
78
|
const uploadedFiles = toUpload.length > 0 ? await Promise.all(toUpload.map((blob) => this.files.upload(blob))) : [];
|
|
80
79
|
const allFiles = [...alreadyUploaded, ...uploadedFiles];
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
imageUris = images.map((f) => f.uri);
|
|
85
|
-
if (others.length > 0)
|
|
86
|
-
fileUris = others.map((f) => f.uri);
|
|
80
|
+
if (allFiles.length > 0) {
|
|
81
|
+
attachments = allFiles.map(({ id, uri, filename, content_type, size }) => ({ id, uri, filename, content_type, size }));
|
|
82
|
+
}
|
|
87
83
|
}
|
|
88
|
-
const input = { text,
|
|
84
|
+
const input = attachments ? { text, attachments } : { text };
|
|
89
85
|
const body = {
|
|
90
86
|
chat_id: this.chatId ?? undefined,
|
|
91
87
|
context: this.context,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* chats, engines and teams send PATCH; apps.patch and flows.patch are the
|
|
13
13
|
* partial siblings of the POST updates that also edit a version.
|
|
14
14
|
*/
|
|
15
|
-
import type { AgentConfigInput, AgentImages, AppDTO, ChatDTO, EngineDTO, FlowDTO, FlowVersionDTO, KnowledgeDTO,
|
|
15
|
+
import type { AgentConfigInput, AgentImages, AppDTO, ChatDTO, CredentialRequirements, EngineDTO, FlowDTO, FlowVersionDTO, KnowledgeDTO, ProjectDTO, TeamDTO, Visibility } from '../types.js';
|
|
16
16
|
/**
|
|
17
17
|
* POST /agents/{id}. Visibility and images, and a new version when
|
|
18
18
|
* `version` is set. Name, title, harness, placement: set at creation.
|
|
@@ -88,9 +88,12 @@ export type TeamUpdateBody = Partial<Pick<TeamDTO, 'name' | 'email' | 'avatar_ur
|
|
|
88
88
|
/**
|
|
89
89
|
* PUT /mcp-servers/{id}. A field left out keeps its value. Title,
|
|
90
90
|
* description, icon URL and documentation URL take what is sent, and ""
|
|
91
|
-
* clears them; slug, name
|
|
92
|
-
*
|
|
93
|
-
*
|
|
91
|
+
* clears them; slug, name and server URL change only to a non-empty value.
|
|
92
|
+
* Headers sent replace the set ({} clears it); default scopes sent replace
|
|
93
|
+
* the list; `credentials` sent replace the declaration of the provider the
|
|
94
|
+
* server signs in through ([] clears it). Auth type is the server's own
|
|
95
|
+
* report. The provider's OAuth app: `PUT /credentials/{slug}/app`.
|
|
96
|
+
* Visibility: `POST /mcp-servers/{id}/visibility`.
|
|
94
97
|
*/
|
|
95
98
|
export interface MCPServerUpdateBody {
|
|
96
99
|
slug?: string;
|
|
@@ -99,12 +102,10 @@ export interface MCPServerUpdateBody {
|
|
|
99
102
|
description?: string;
|
|
100
103
|
icon_url?: string;
|
|
101
104
|
server_url?: string;
|
|
102
|
-
auth_type?: MCPServerAuthType;
|
|
103
|
-
oauth_client_id?: string;
|
|
104
|
-
oauth_secret_key?: string;
|
|
105
105
|
default_scopes?: string[];
|
|
106
106
|
headers?: {
|
|
107
107
|
[key: string]: string;
|
|
108
108
|
};
|
|
109
109
|
documentation_url?: string;
|
|
110
|
+
credentials?: CredentialRequirements;
|
|
110
111
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export { STREAM_FORMAT, CLEAR_KEY, ERROR_KEY, REDIAL_CODES } from './live/protoc
|
|
|
32
32
|
export { isLiveField, parseMediaType, pcmFormat, splitLiveSchema, binaryLiveField, alternativeLabel, alternativeTag, } from './live/schema.js';
|
|
33
33
|
export type { JsonSchema, MediaType, PCMFormat, LiveField } from './live/schema.js';
|
|
34
34
|
export { tool, appTool, agentTool, webhookTool, httpTool, callTool, mcpTool, internalTools, string, number, integer, boolean, enumOf, object, array, optional, } from './tool-builder.js';
|
|
35
|
-
export type { ClientTool, ClientToolHandler } from './tool-builder.js';
|
|
35
|
+
export type { ClientTool, ClientToolHandler, ClientToolResult } from './tool-builder.js';
|
|
36
36
|
export { lifecycleHook, learningHooks } from './hook-builder.js';
|
|
37
37
|
export type { LifecycleHookBuilder } from './hook-builder.js';
|
|
38
38
|
export { DeltaAccumulator, createLLMDeltaAccumulator, type DeltaEvent, type FieldTags, type FieldTagsRegistry } from './delta.js';
|
package/dist/tool-builder.d.ts
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tool Builder - Fluent API for defining agent tools
|
|
3
3
|
*/
|
|
4
|
-
import { AgentTool, InternalToolsConfig } from './types.js';
|
|
4
|
+
import { AgentTool, FileRef, InternalToolsConfig } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* What a client tool handler returns: the result text, or the text plus files.
|
|
7
|
+
*
|
|
8
|
+
* `attachments` are files already uploaded with POST /files (for example with
|
|
9
|
+
* `client.files.upload(dataUrlOrBlob)` or the chat's `uploadFile`), passed as
|
|
10
|
+
* `FileRef`s, the same as message attachments. An image attachment reaches the
|
|
11
|
+
* model as image input when the model supports images; other files are listed
|
|
12
|
+
* on the tool message.
|
|
13
|
+
*/
|
|
14
|
+
export type ClientToolResult = string | {
|
|
15
|
+
result: string;
|
|
16
|
+
attachments?: FileRef[];
|
|
17
|
+
};
|
|
5
18
|
/** Handler function for client tools (executed in browser/Node) */
|
|
6
|
-
export type ClientToolHandler = (args: Record<string, unknown>) => Promise<
|
|
19
|
+
export type ClientToolHandler = (args: Record<string, unknown>) => Promise<ClientToolResult> | ClientToolResult;
|
|
7
20
|
/** Client tool with schema and handler bundled together */
|
|
8
21
|
export interface ClientTool {
|
|
9
22
|
/** Tool schema (sent to server, describes the tool to the LLM) */
|
|
@@ -113,13 +126,29 @@ export declare const webhookTool: (name: string, url: string) => WebhookToolBuil
|
|
|
113
126
|
export declare const httpTool: (name: string, url: string) => HTTPToolBuilder;
|
|
114
127
|
/** Create a call tool — makes authenticated HTTP requests. Preferred name for httpTool. */
|
|
115
128
|
export declare const callTool: (name: string, url: string) => HTTPToolBuilder;
|
|
116
|
-
/**
|
|
117
|
-
|
|
118
|
-
|
|
129
|
+
/** What an MCP tool calls: a tool on a server, named by the server's slug. */
|
|
130
|
+
export interface MCPToolTarget {
|
|
131
|
+
/** The MCP server's slug (a workspace registration or a directory entry). */
|
|
132
|
+
server: string;
|
|
133
|
+
toolName: string;
|
|
134
|
+
/** Pins one connection to the server's provider; by default the runner's own is used. */
|
|
135
|
+
credentialId?: string;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* 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.
|
|
145
|
+
*/
|
|
146
|
+
export declare function mcpTool(name: string, target: MCPToolTarget | string, toolName?: string): MCPToolBuilder;
|
|
119
147
|
declare class MCPToolBuilder extends ToolBuilder {
|
|
120
|
-
private
|
|
121
|
-
|
|
122
|
-
|
|
148
|
+
private target;
|
|
149
|
+
constructor(name: string, target: Partial<MCPToolTarget> & {
|
|
150
|
+
toolName: string;
|
|
151
|
+
});
|
|
123
152
|
build(): AgentTool;
|
|
124
153
|
}
|
|
125
154
|
declare class InternalToolsBuilder {
|
package/dist/tool-builder.js
CHANGED
|
@@ -236,14 +236,25 @@ export const webhookTool = (name, url) => new WebhookToolBuilder(name, url);
|
|
|
236
236
|
export const httpTool = (name, url) => new HTTPToolBuilder(name, url);
|
|
237
237
|
/** Create a call tool — makes authenticated HTTP requests. Preferred name for httpTool. */
|
|
238
238
|
export const callTool = (name, url) => new HTTPToolBuilder(name, url);
|
|
239
|
-
/**
|
|
240
|
-
|
|
241
|
-
|
|
239
|
+
/**
|
|
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.
|
|
247
|
+
*/
|
|
248
|
+
export function mcpTool(name, target, toolName) {
|
|
249
|
+
if (typeof target === 'string') {
|
|
250
|
+
return new MCPToolBuilder(name, { toolName: toolName ?? '', credentialId: target });
|
|
251
|
+
}
|
|
252
|
+
return new MCPToolBuilder(name, target);
|
|
253
|
+
}
|
|
242
254
|
class MCPToolBuilder extends ToolBuilder {
|
|
243
|
-
constructor(name,
|
|
255
|
+
constructor(name, target) {
|
|
244
256
|
super(name);
|
|
245
|
-
this.
|
|
246
|
-
this.toolName = toolName;
|
|
257
|
+
this.target = target;
|
|
247
258
|
}
|
|
248
259
|
build() {
|
|
249
260
|
return {
|
|
@@ -252,7 +263,11 @@ class MCPToolBuilder extends ToolBuilder {
|
|
|
252
263
|
description: this.desc,
|
|
253
264
|
type: ToolTypeMCP,
|
|
254
265
|
require_approval: this.approval || undefined,
|
|
255
|
-
mcp: {
|
|
266
|
+
mcp: {
|
|
267
|
+
tool_name: this.target.toolName,
|
|
268
|
+
...(this.target.server ? { server: this.target.server } : {}),
|
|
269
|
+
...(this.target.credentialId ? { credential_id: this.target.credentialId } : {}),
|
|
270
|
+
},
|
|
256
271
|
};
|
|
257
272
|
}
|
|
258
273
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -200,9 +200,18 @@ export interface HTTPToolConfig {
|
|
|
200
200
|
input_schema?: any;
|
|
201
201
|
output_schema?: any;
|
|
202
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* MCPToolConfig is a tool of an MCP server: the server by its slug (the
|
|
205
|
+
* agent's team's registration, its org's or the directory's) and the tool
|
|
206
|
+
* to call. CredentialID pins the connection the call signs in with; without
|
|
207
|
+
* it the runner's connection to the server's provider is used. A tool
|
|
208
|
+
* written with only a connection is saved with the server that
|
|
209
|
+
* connection's provider is declared by.
|
|
210
|
+
*/
|
|
203
211
|
export interface MCPToolConfig {
|
|
204
|
-
|
|
212
|
+
server?: string;
|
|
205
213
|
tool_name: string;
|
|
214
|
+
credential_id?: string;
|
|
206
215
|
}
|
|
207
216
|
export interface AppToolConfigDTO {
|
|
208
217
|
ref: string;
|
|
@@ -253,8 +262,9 @@ export interface HTTPToolConfigDTO {
|
|
|
253
262
|
output_schema?: any;
|
|
254
263
|
}
|
|
255
264
|
export interface MCPToolConfigDTO {
|
|
256
|
-
|
|
265
|
+
server: string;
|
|
257
266
|
tool_name: string;
|
|
267
|
+
credential_id?: string;
|
|
258
268
|
}
|
|
259
269
|
/**
|
|
260
270
|
* AgentImages contains display images for an agent
|
|
@@ -4016,7 +4026,6 @@ export interface MCPServerDTO {
|
|
|
4016
4026
|
icon_url: string;
|
|
4017
4027
|
server_url: string;
|
|
4018
4028
|
auth_type: MCPServerAuthType;
|
|
4019
|
-
oauth_client_id?: string;
|
|
4020
4029
|
default_scopes: StringSlice;
|
|
4021
4030
|
/**
|
|
4022
4031
|
* Headers are static HTTP headers sent on every request to the server,
|
|
@@ -4037,12 +4046,44 @@ export interface MCPServerDTO {
|
|
|
4037
4046
|
*/
|
|
4038
4047
|
credentials?: CredentialRequirements;
|
|
4039
4048
|
credential_slug?: string;
|
|
4049
|
+
/**
|
|
4050
|
+
* Deprecated: Connection.Status. Kept for clients reading it.
|
|
4051
|
+
*/
|
|
4040
4052
|
connection_status?: string;
|
|
4041
4053
|
/**
|
|
4042
|
-
* ConnectionScope is who the caller's connection to this server belongs
|
|
4054
|
+
* Deprecated: Connection.Scope. ConnectionScope is who the caller's connection to this server belongs
|
|
4043
4055
|
* to (user, team, org, platform); empty when not connected.
|
|
4044
4056
|
*/
|
|
4045
4057
|
connection_scope?: CredentialScope;
|
|
4058
|
+
/**
|
|
4059
|
+
* Connection is the whole of it: the login's status and scope above,
|
|
4060
|
+
* and what the connection made with that login holds.
|
|
4061
|
+
*/
|
|
4062
|
+
connection?: ConnectionInfo;
|
|
4063
|
+
}
|
|
4064
|
+
/**
|
|
4065
|
+
* ConnectionInfo is the caller's standing with a server: their login's
|
|
4066
|
+
* status (connected, expired, error; "" when they hold none) and whose it
|
|
4067
|
+
* is, and what the connection made with that login holds.
|
|
4068
|
+
*/
|
|
4069
|
+
export interface ConnectionInfo extends MCPConnectionFacts {
|
|
4070
|
+
/**
|
|
4071
|
+
* Status and Scope are the caller's login's for the server: whether
|
|
4072
|
+
* they can call it, and whose the login is.
|
|
4073
|
+
*/
|
|
4074
|
+
status?: string;
|
|
4075
|
+
scope?: CredentialScope;
|
|
4076
|
+
}
|
|
4077
|
+
/**
|
|
4078
|
+
* MCPConnectionFacts is what an MCP connection (a server reached through
|
|
4079
|
+
* one login) has recorded: the catalogue it listed, its last call.
|
|
4080
|
+
*/
|
|
4081
|
+
export interface MCPConnectionFacts {
|
|
4082
|
+
connection_id?: string;
|
|
4083
|
+
tool_count?: number;
|
|
4084
|
+
tools_listed_at?: string;
|
|
4085
|
+
last_called_at?: string;
|
|
4086
|
+
last_error?: string;
|
|
4046
4087
|
}
|
|
4047
4088
|
/**
|
|
4048
4089
|
* MCPServerSetup is what a server's directory entry knows about setting the
|
|
@@ -6464,9 +6505,24 @@ export interface StreamDelta {
|
|
|
6464
6505
|
export interface LLMOutput {
|
|
6465
6506
|
response: string;
|
|
6466
6507
|
reasoning?: string;
|
|
6508
|
+
reasoning_state?: ReasoningState;
|
|
6467
6509
|
tool_calls?: ToolCall[];
|
|
6468
6510
|
usage?: LLMUsage;
|
|
6469
6511
|
}
|
|
6512
|
+
/**
|
|
6513
|
+
* ReasoningState is the opaque state a model hands back with a response for
|
|
6514
|
+
* the next request to carry: a signature over its reasoning (Anthropic
|
|
6515
|
+
* thinking, Gemini thought_signature) or the reasoning itself encrypted
|
|
6516
|
+
* (OpenAI). The platform never reads it. An app writes its own entry under
|
|
6517
|
+
* its own key and, replaying a conversation, places only the entries it
|
|
6518
|
+
* wrote: another provider's signature in its request is refused. The agent
|
|
6519
|
+
* loop stores every assistant message's state and sends all of it back, so a
|
|
6520
|
+
* conversation that moves between models keeps each one's state for it.
|
|
6521
|
+
* Not on LLMDelta: the state is whole only on the final output.
|
|
6522
|
+
*/
|
|
6523
|
+
export type ReasoningState = {
|
|
6524
|
+
[key: string]: any;
|
|
6525
|
+
};
|
|
6470
6526
|
/**
|
|
6471
6527
|
* LLMDelta is a streaming delta for LLMOutput.
|
|
6472
6528
|
*/
|
|
@@ -6612,6 +6668,11 @@ export interface LLMContextMessage {
|
|
|
6612
6668
|
role: ChatMessageRole;
|
|
6613
6669
|
text?: string;
|
|
6614
6670
|
reasoning?: string;
|
|
6671
|
+
/**
|
|
6672
|
+
* ReasoningState is what the model's output carried, on an assistant
|
|
6673
|
+
* message: see ReasoningState.
|
|
6674
|
+
*/
|
|
6675
|
+
reasoning_state?: ReasoningState;
|
|
6615
6676
|
images?: string[];
|
|
6616
6677
|
files?: string[];
|
|
6617
6678
|
tools?: Tool[];
|
|
@@ -6876,7 +6937,7 @@ export declare const ContentUnrated: ContentRating;
|
|
|
6876
6937
|
/**
|
|
6877
6938
|
* CredentialProvider names the external service a credential is for.
|
|
6878
6939
|
*/
|
|
6879
|
-
export type CredentialProvider = "google" | "google-sa" | "slack" | "notion" | "github" | "x" | "microsoft" | "salesforce" | "discord" | "gcp" | "
|
|
6940
|
+
export type CredentialProvider = "google" | "google-sa" | "slack" | "notion" | "github" | "x" | "microsoft" | "salesforce" | "discord" | "gcp" | "reddit";
|
|
6880
6941
|
/**
|
|
6881
6942
|
* Credential.Provider is a plain string; cast with string(...) when assigning.
|
|
6882
6943
|
*/
|
|
@@ -6917,10 +6978,6 @@ export declare const CredentialProviderDiscord: CredentialProvider;
|
|
|
6917
6978
|
* Credential.Provider is a plain string; cast with string(...) when assigning.
|
|
6918
6979
|
*/
|
|
6919
6980
|
export declare const CredentialProviderGCP: CredentialProvider;
|
|
6920
|
-
/**
|
|
6921
|
-
* Credential.Provider is a plain string; cast with string(...) when assigning.
|
|
6922
|
-
*/
|
|
6923
|
-
export declare const CredentialProviderMCP: CredentialProvider;
|
|
6924
6981
|
/**
|
|
6925
6982
|
* Credential.Provider is a plain string; cast with string(...) when assigning.
|
|
6926
6983
|
*/
|
|
@@ -6928,10 +6985,9 @@ export declare const CredentialProviderReddit: CredentialProvider;
|
|
|
6928
6985
|
/**
|
|
6929
6986
|
* CredentialType describes the credential category.
|
|
6930
6987
|
*/
|
|
6931
|
-
export type CredentialType = "oauth" | "api_key" | "
|
|
6988
|
+
export type CredentialType = "oauth" | "api_key" | "service_account" | "wif";
|
|
6932
6989
|
export declare const CredentialTypeOAuth: CredentialType;
|
|
6933
6990
|
export declare const CredentialTypeAPIKey: CredentialType;
|
|
6934
|
-
export declare const CredentialTypeMCP: CredentialType;
|
|
6935
6991
|
export declare const CredentialTypeServiceAccount: CredentialType;
|
|
6936
6992
|
export declare const CredentialTypeWIF: CredentialType;
|
|
6937
6993
|
/**
|
package/dist/types.js
CHANGED
|
@@ -1238,17 +1238,12 @@ export const CredentialProviderDiscord = "discord";
|
|
|
1238
1238
|
* Credential.Provider is a plain string; cast with string(...) when assigning.
|
|
1239
1239
|
*/
|
|
1240
1240
|
export const CredentialProviderGCP = "gcp";
|
|
1241
|
-
/**
|
|
1242
|
-
* Credential.Provider is a plain string; cast with string(...) when assigning.
|
|
1243
|
-
*/
|
|
1244
|
-
export const CredentialProviderMCP = "mcp";
|
|
1245
1241
|
/**
|
|
1246
1242
|
* Credential.Provider is a plain string; cast with string(...) when assigning.
|
|
1247
1243
|
*/
|
|
1248
1244
|
export const CredentialProviderReddit = "reddit";
|
|
1249
1245
|
export const CredentialTypeOAuth = "oauth";
|
|
1250
1246
|
export const CredentialTypeAPIKey = "api_key";
|
|
1251
|
-
export const CredentialTypeMCP = "mcp";
|
|
1252
1247
|
export const CredentialTypeServiceAccount = "service_account";
|
|
1253
1248
|
export const CredentialTypeWIF = "wif";
|
|
1254
1249
|
export const CredentialStatusPending = "pending";
|