@proteos/sdk 0.82.0 → 0.82.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/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/agent/session-types.ts +7 -0
- package/src/agent/sessions.ts +19 -3
package/package.json
CHANGED
|
@@ -381,6 +381,13 @@ export interface AppendEventRequest {
|
|
|
381
381
|
*/
|
|
382
382
|
turn_id?: string
|
|
383
383
|
payload?: unknown
|
|
384
|
+
/**
|
|
385
|
+
* The sending surface's client-tool catalog, `user.message` only. A surface that
|
|
386
|
+
* opened a session it did not create attaches its tools this way: when the names
|
|
387
|
+
* differ from the session's client tools they replace them before the turn runs.
|
|
388
|
+
* Omitted, the session's tools are left as they are.
|
|
389
|
+
*/
|
|
390
|
+
client_tools?: ClientToolSchema[]
|
|
384
391
|
}
|
|
385
392
|
|
|
386
393
|
/** List filter for sessions (in addition to pagination/sorting). */
|
package/src/agent/sessions.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { PageIterator } from '../iterator.js'
|
|
|
3
3
|
import type { ListResult } from '../types/common.js'
|
|
4
4
|
import type {
|
|
5
5
|
AppendEventRequest,
|
|
6
|
+
ClientToolSchema,
|
|
6
7
|
ContentBlock,
|
|
7
8
|
CreateSessionRequest,
|
|
8
9
|
FileBlock,
|
|
@@ -62,11 +63,19 @@ export interface SessionService {
|
|
|
62
63
|
* backend uploads it to the model provider and mounts it into the agent's sandbox
|
|
63
64
|
* at send time. Pass `turnId` (a UUID) for optimistic rendering. At least one of
|
|
64
65
|
* `text` / `files` should be present. `context` rides the payload for the model
|
|
65
|
-
* only (see {@link UserMessagePayload.context}).
|
|
66
|
+
* only (see {@link UserMessagePayload.context}). `clientTools` attaches the
|
|
67
|
+
* sending surface's client tools to a session it did not create (see
|
|
68
|
+
* {@link AppendEventRequest.client_tools}).
|
|
66
69
|
*/
|
|
67
70
|
sendUserMessage(
|
|
68
71
|
id: string,
|
|
69
|
-
input: {
|
|
72
|
+
input: {
|
|
73
|
+
text?: string
|
|
74
|
+
files?: FileBlock[]
|
|
75
|
+
turnId?: string
|
|
76
|
+
context?: string
|
|
77
|
+
clientTools?: ClientToolSchema[]
|
|
78
|
+
},
|
|
70
79
|
): Promise<SessionEvent>
|
|
71
80
|
/** Convenience: appends a `user.interrupt` to halt the running turn. */
|
|
72
81
|
interrupt(id: string): Promise<SessionEvent>
|
|
@@ -150,7 +159,13 @@ export class SessionServiceImpl implements SessionService {
|
|
|
150
159
|
|
|
151
160
|
async sendUserMessage(
|
|
152
161
|
id: string,
|
|
153
|
-
input: {
|
|
162
|
+
input: {
|
|
163
|
+
text?: string
|
|
164
|
+
files?: FileBlock[]
|
|
165
|
+
turnId?: string
|
|
166
|
+
context?: string
|
|
167
|
+
clientTools?: ClientToolSchema[]
|
|
168
|
+
},
|
|
154
169
|
): Promise<SessionEvent> {
|
|
155
170
|
const content: ContentBlock[] = []
|
|
156
171
|
const text = input.text?.trim()
|
|
@@ -163,6 +178,7 @@ export class SessionServiceImpl implements SessionService {
|
|
|
163
178
|
type: 'user.message',
|
|
164
179
|
...(input.turnId ? { turn_id: input.turnId } : {}),
|
|
165
180
|
payload: { content, ...(context ? { context } : {}) },
|
|
181
|
+
...(input.clientTools?.length ? { client_tools: input.clientTools } : {}),
|
|
166
182
|
})
|
|
167
183
|
}
|
|
168
184
|
|