@restatedev/agents 0.2.0 → 0.4.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/README.md +89 -49
- package/dist/calls.d.ts +29 -8
- package/dist/calls.d.ts.map +1 -1
- package/dist/calls.js +79 -18
- package/dist/calls.js.map +1 -1
- package/dist/claude/index.d.ts +36 -7
- package/dist/claude/index.d.ts.map +1 -1
- package/dist/claude/index.js +238 -156
- package/dist/claude/index.js.map +1 -1
- package/dist/client.d.ts +12 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js.map +1 -1
- package/dist/common.d.ts +161 -71
- package/dist/common.d.ts.map +1 -1
- package/dist/common.js +277 -226
- package/dist/common.js.map +1 -1
- package/dist/conversation.d.ts +466 -0
- package/dist/conversation.d.ts.map +1 -0
- package/dist/conversation.js +1247 -0
- package/dist/conversation.js.map +1 -0
- package/dist/deepseek/index.d.ts +38 -5
- package/dist/deepseek/index.d.ts.map +1 -1
- package/dist/deepseek/index.js +323 -107
- package/dist/deepseek/index.js.map +1 -1
- package/dist/deepseek/persistence.d.ts +9 -3
- package/dist/deepseek/persistence.d.ts.map +1 -1
- package/dist/deepseek/persistence.js +12 -6
- package/dist/deepseek/persistence.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/langgraph/checkpointer.d.ts +16 -2
- package/dist/langgraph/checkpointer.d.ts.map +1 -1
- package/dist/langgraph/checkpointer.js +133 -26
- package/dist/langgraph/checkpointer.js.map +1 -1
- package/dist/langgraph/context.d.ts +10 -0
- package/dist/langgraph/context.d.ts.map +1 -0
- package/dist/langgraph/context.js +21 -0
- package/dist/langgraph/context.js.map +1 -0
- package/dist/langgraph/errors.d.ts +16 -0
- package/dist/langgraph/errors.d.ts.map +1 -0
- package/dist/langgraph/errors.js +30 -0
- package/dist/langgraph/errors.js.map +1 -0
- package/dist/langgraph/graph.d.ts +25 -0
- package/dist/langgraph/graph.d.ts.map +1 -0
- package/dist/langgraph/graph.js +346 -0
- package/dist/langgraph/graph.js.map +1 -0
- package/dist/langgraph/index.d.ts +65 -12
- package/dist/langgraph/index.d.ts.map +1 -1
- package/dist/langgraph/index.js +234 -180
- package/dist/langgraph/index.js.map +1 -1
- package/dist/langgraph/nodes.d.ts +70 -0
- package/dist/langgraph/nodes.d.ts.map +1 -0
- package/dist/langgraph/nodes.js +145 -0
- package/dist/langgraph/nodes.js.map +1 -0
- package/dist/messages.d.ts +18 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +182 -0
- package/dist/messages.js.map +1 -0
- package/dist/object.d.ts +65 -23
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +123 -40
- package/dist/object.js.map +1 -1
- package/dist/output.d.ts +15 -7
- package/dist/output.d.ts.map +1 -1
- package/dist/output.js +44 -26
- package/dist/output.js.map +1 -1
- package/dist/pi/index.d.ts +39 -11
- package/dist/pi/index.d.ts.map +1 -1
- package/dist/pi/index.js +281 -77
- package/dist/pi/index.js.map +1 -1
- package/dist/pi/storage.d.ts +29 -4
- package/dist/pi/storage.d.ts.map +1 -1
- package/dist/pi/storage.js +18 -6
- package/dist/pi/storage.js.map +1 -1
- package/dist/signals.d.ts +75 -7
- package/dist/signals.d.ts.map +1 -1
- package/dist/signals.js +154 -27
- package/dist/signals.js.map +1 -1
- package/dist/steering.d.ts +31 -0
- package/dist/steering.d.ts.map +1 -0
- package/dist/steering.js +45 -0
- package/dist/steering.js.map +1 -0
- package/dist/tools.d.ts +28 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +34 -5
- package/dist/tools.js.map +1 -1
- package/package.json +33 -37
- package/src/calls.ts +110 -24
- package/src/claude/README.md +41 -20
- package/src/claude/index.ts +271 -183
- package/src/client.ts +14 -3
- package/src/common.ts +354 -247
- package/src/conversation.ts +1527 -0
- package/src/deepseek/README.md +78 -11
- package/src/deepseek/index.ts +385 -138
- package/src/deepseek/persistence.ts +11 -8
- package/src/index.ts +13 -4
- package/src/langgraph/README.md +115 -25
- package/src/langgraph/checkpointer.ts +168 -28
- package/src/langgraph/context.ts +27 -0
- package/src/langgraph/errors.ts +26 -0
- package/src/langgraph/graph.ts +396 -0
- package/src/langgraph/index.ts +337 -193
- package/src/langgraph/nodes.ts +243 -0
- package/src/messages.ts +244 -0
- package/src/object.ts +178 -48
- package/src/output.ts +52 -31
- package/src/pi/README.md +18 -3
- package/src/pi/index.ts +346 -79
- package/src/pi/storage.ts +20 -7
- package/src/signals.ts +235 -31
- package/src/steering.ts +67 -0
- package/src/tools.ts +61 -8
- package/dist/claude/conversation.d.ts +0 -33
- package/dist/claude/conversation.d.ts.map +0 -1
- package/dist/claude/conversation.js +0 -95
- package/dist/claude/conversation.js.map +0 -1
- package/dist/log.d.ts +0 -29
- package/dist/log.d.ts.map +0 -1
- package/dist/log.js +0 -145
- package/dist/log.js.map +0 -1
- package/dist/opencode/db.d.ts +0 -40
- package/dist/opencode/db.d.ts.map +0 -1
- package/dist/opencode/db.js +0 -161
- package/dist/opencode/db.js.map +0 -1
- package/dist/opencode/index.d.ts +0 -100
- package/dist/opencode/index.d.ts.map +0 -1
- package/dist/opencode/index.js +0 -436
- package/dist/opencode/index.js.map +0 -1
- package/src/claude/conversation.ts +0 -114
- package/src/log.ts +0 -193
- package/src/opencode/README.md +0 -125
- package/src/opencode/db.ts +0 -223
- package/src/opencode/index.ts +0 -559
package/dist/claude/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Claude agents in Restate virtual objects, on the tool runner of the
|
|
2
|
-
// Anthropic SDK (`client.beta.messages.toolRunner`): the conversation is
|
|
3
|
-
//
|
|
2
|
+
// Anthropic SDK (`client.beta.messages.toolRunner`): the conversation is the
|
|
3
|
+
// object's conversation of turns (../conversation.ts), whose items are the
|
|
4
|
+
// SDK's messages (`BetaMessageParam`).
|
|
4
5
|
//
|
|
5
6
|
// const assistant = claude.agent({ name: 'assistant', system: 'Answer briefly.', tools: [weather] });
|
|
6
7
|
//
|
|
@@ -12,36 +13,123 @@
|
|
|
12
13
|
// with ANTHROPIC_API_KEY.
|
|
13
14
|
//
|
|
14
15
|
// The handler is not replayed: a retried attempt (a crash, a lost connection)
|
|
15
|
-
// runs again from the start, and starts the runner with the
|
|
16
|
+
// runs again from the start, and starts the runner with what the model sees
|
|
17
|
+
// of the conversation (`history()`: the earlier turns as their prompts and
|
|
18
|
+
// answers, the latest whole):
|
|
16
19
|
// - Each reply of the model is stored before its tools run, and their results
|
|
17
20
|
// before the next request. So a crash during the tools resumes them with the
|
|
18
21
|
// same tool call ids (`callId(context)`), without asking the model again,
|
|
19
|
-
// and a tool passes the id on to stay idempotent.
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
// - A reply cut off at `maxTokens`,
|
|
25
|
-
// calls do not run, and the handler fails
|
|
22
|
+
// and a tool passes the id on to stay idempotent. A stored final reply is
|
|
23
|
+
// the answer: the model is not asked for it again.
|
|
24
|
+
// - A tool's error fails the attempt, which Restate retries; but the SDK's
|
|
25
|
+
// `ToolError`, which is meant for the model, is the tool's result.
|
|
26
|
+
// - A message is answered once per invocation (`answerOnce`).
|
|
27
|
+
// - A reply cut off at `maxTokens`, declined, or past the model's context
|
|
28
|
+
// window ends the turn: its tool calls do not run, and the handler fails
|
|
29
|
+
// with a terminal error.
|
|
30
|
+
// - With `output`, a model with structured outputs is asked for it natively:
|
|
31
|
+
// each request of the run has its JSON schema (`output_config.format`),
|
|
32
|
+
// which holds the final reply to it, and tool calls go on as before. The
|
|
33
|
+
// reply is checked all the same (output.ts).
|
|
26
34
|
import * as restate from '@restatedev/sessions';
|
|
35
|
+
import { ScopeKey } from '@restatedev/sessions/internal';
|
|
27
36
|
import Anthropic from '@anthropic-ai/sdk';
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
37
|
+
import { betaZodOutputFormat } from '@anthropic-ai/sdk/helpers/beta/zod';
|
|
38
|
+
import { ToolError } from '@anthropic-ai/sdk/lib/tools/ToolError';
|
|
39
|
+
import { chatHandler, CLAUDE_MODEL, configured, fromTool, modelIdOf, modelOf, RETURNED_UNRECORDED, stopSignalOf, toolCallEnded, toolCallStarted, NO_ANSWER, } from '../common.js';
|
|
40
|
+
import { answerOnce } from '../conversation.js';
|
|
41
|
+
import { takeSteers } from '../steering.js';
|
|
42
|
+
import { conversationView } from '../messages.js';
|
|
43
|
+
import { withChecked } from '../output.js';
|
|
30
44
|
import { sessionObject } from '../object.js';
|
|
31
45
|
import { isTool, jsonSchemaOf } from '../tools.js';
|
|
32
|
-
import { Conversation } from './conversation.js';
|
|
33
46
|
/** The id of the tool call a tool runs for: the runner always passes it. */
|
|
34
47
|
export const callId = (context) => {
|
|
35
48
|
if (!context)
|
|
36
49
|
throw new Error('a tool call without its context');
|
|
37
50
|
return context.toolUse.id;
|
|
38
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* `messages` as the API takes them: it refuses an empty text, and an
|
|
54
|
+
* assistant's message with no content but the last. The model may reply
|
|
55
|
+
* with nothing (stored as it came): sent back, such a reply says so.
|
|
56
|
+
*/
|
|
57
|
+
const sendable = (messages) => messages.map((m) => {
|
|
58
|
+
if (m.role !== 'assistant')
|
|
59
|
+
return m;
|
|
60
|
+
if (typeof m.content === 'string')
|
|
61
|
+
return m.content.trim() ? m : { ...m, content: NO_ANSWER };
|
|
62
|
+
const content = m.content.filter((b) => b.type !== 'text' || b.text.trim() !== '');
|
|
63
|
+
if (content.length === 0)
|
|
64
|
+
return { ...m, content: NO_ANSWER };
|
|
65
|
+
return content.length === m.content.length ? m : { ...m, content };
|
|
66
|
+
});
|
|
67
|
+
/** The text of stored content, without its tool calls and results. */
|
|
68
|
+
const storedText = (content) => typeof content === 'string' ? content : (content ?? []).flatMap((b) => (b.type === 'text' ? [b.text] : [])).join('');
|
|
69
|
+
/**
|
|
70
|
+
* Claude's items: the SDK's messages, as JSON. A user's text is said by the
|
|
71
|
+
* user, an assistant's by the assistant, and its `tool_use` blocks are its
|
|
72
|
+
* calls; a `tool_result` is a result. A server tool's blocks (and a
|
|
73
|
+
* `system` message) say nothing: they leave no open call the API would
|
|
74
|
+
* refuse a result for.
|
|
75
|
+
*/
|
|
76
|
+
export const items = {
|
|
77
|
+
dump: (message) => JSON.stringify(message),
|
|
78
|
+
load: (stored) => {
|
|
79
|
+
// Only a message of the API's (a role and its content): another framework's row is not one.
|
|
80
|
+
const message = JSON.parse(stored);
|
|
81
|
+
const { role, content, ...rest } = message;
|
|
82
|
+
if ((role !== 'user' && role !== 'assistant') || (typeof content !== 'string' && !Array.isArray(content)))
|
|
83
|
+
throw new Error('not a message of the Claude API (a role and its content)');
|
|
84
|
+
if (Object.keys(rest).length > 0)
|
|
85
|
+
throw new Error(`not a message of the Claude API: ${Object.keys(rest).join(', ')}`);
|
|
86
|
+
return message;
|
|
87
|
+
},
|
|
88
|
+
prompt: (text) => ({ role: 'user', content: text }),
|
|
89
|
+
// The API refuses an empty text: an empty answer, as the model sees it later, says so.
|
|
90
|
+
reply: (text) => ({ role: 'assistant', content: text.trim() ? text : NO_ANSWER }),
|
|
91
|
+
// Every result of a reply in one message, as the API wants them.
|
|
92
|
+
results: (results) => results.length === 0
|
|
93
|
+
? []
|
|
94
|
+
: [
|
|
95
|
+
{
|
|
96
|
+
role: 'user',
|
|
97
|
+
content: results.map(([call, output]) => ({
|
|
98
|
+
type: 'tool_result',
|
|
99
|
+
tool_use_id: call.id,
|
|
100
|
+
content: output,
|
|
101
|
+
...(output === RETURNED_UNRECORDED ? {} : { is_error: true }),
|
|
102
|
+
})),
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
read: (message) => {
|
|
106
|
+
if (message.role !== 'user' && message.role !== 'assistant')
|
|
107
|
+
return {};
|
|
108
|
+
const { role, content } = message;
|
|
109
|
+
if (typeof content === 'string')
|
|
110
|
+
return { said: [role, content] };
|
|
111
|
+
const texts = content.filter((b) => b.type === 'text');
|
|
112
|
+
const calls = content.flatMap((b) => (b.type === 'tool_use' ? [{ id: b.id, name: b.name, input: b.input }] : []));
|
|
113
|
+
const results = content.flatMap((b) => b.type === 'tool_result'
|
|
114
|
+
? [{ id: b.tool_use_id, output: storedText(b.content), error: b.is_error === true }]
|
|
115
|
+
: []);
|
|
116
|
+
// Each reply of the model is a message of its own, its tool calls' too (as
|
|
117
|
+
// the views gave them before); a message of results only says nothing.
|
|
118
|
+
const said = role === 'assistant' || texts.length > 0;
|
|
119
|
+
return {
|
|
120
|
+
...(said ? { said: [role, texts.map((b) => b.text).join('')] } : {}),
|
|
121
|
+
calls,
|
|
122
|
+
results,
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
};
|
|
39
126
|
/**
|
|
40
127
|
* `tools`, whose errors fail the attempt: the runner would hand a thrown error
|
|
41
128
|
* to the model as the tool's result, so each one is kept, for `check()` to
|
|
42
|
-
* throw once the tools ran.
|
|
129
|
+
* throw once the tools ran. The SDK's `ToolError` is for the model: the
|
|
130
|
+
* runner hands it over as the tool's result.
|
|
43
131
|
*/
|
|
44
|
-
function failing(tools) {
|
|
132
|
+
function failing(ctx, tools) {
|
|
45
133
|
let failure;
|
|
46
134
|
return {
|
|
47
135
|
tools: tools.map((tool) => ({
|
|
@@ -51,7 +139,9 @@ function failing(tools) {
|
|
|
51
139
|
return await tool.run(args, context);
|
|
52
140
|
}
|
|
53
141
|
catch (e) {
|
|
54
|
-
|
|
142
|
+
if (e instanceof ToolError)
|
|
143
|
+
throw e;
|
|
144
|
+
fromTool(ctx, e);
|
|
55
145
|
failure ??= e;
|
|
56
146
|
throw e;
|
|
57
147
|
}
|
|
@@ -68,72 +158,100 @@ const textOf = (content) => content
|
|
|
68
158
|
.map((c) => c.text)
|
|
69
159
|
.join('');
|
|
70
160
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* the clients that follow
|
|
161
|
+
* The run of `agent` on the conversation: from the stored turn on, each
|
|
162
|
+
* reply stored before its tools run, and their results after; each round of
|
|
163
|
+
* tool calls published as it starts and ends (for the clients that follow
|
|
164
|
+
* the conversation). At each step (before a request that follows the
|
|
165
|
+
* prompt or the tools' results), it takes the messages steered to the turn
|
|
166
|
+
* (`takeSteers`): the request then goes out from the conversation's
|
|
167
|
+
* history, which has them after the tools' results.
|
|
74
168
|
*/
|
|
75
|
-
|
|
76
|
-
const {
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
169
|
+
const runOf = (ctx, agent) => async (conversation) => {
|
|
170
|
+
const { client, model, maxTokens, effort, system, format } = agent;
|
|
171
|
+
const turn = conversation.turn;
|
|
172
|
+
for (;;) {
|
|
173
|
+
// A stored final reply is the answer: the model is not asked for it again.
|
|
174
|
+
const final = turn.finalReply();
|
|
175
|
+
if (final !== undefined)
|
|
176
|
+
return final;
|
|
177
|
+
// A paused reply goes back as the last message, which a steered one would not leave it.
|
|
178
|
+
if (turn.entries.at(-1).parsed?.said?.[0] !== 'assistant')
|
|
179
|
+
await takeSteers(ctx, conversation);
|
|
180
|
+
const { tools, check } = failing(ctx, agent.tools);
|
|
181
|
+
const runner = client.beta.messages.toolRunner({
|
|
182
|
+
model,
|
|
183
|
+
max_tokens: maxTokens,
|
|
184
|
+
...(effort === undefined && format === undefined ? {} : { output_config: { effort, format } }),
|
|
185
|
+
...(system === undefined ? {} : { system }),
|
|
186
|
+
tools,
|
|
187
|
+
messages: sendable(conversation.history()),
|
|
188
|
+
}, { signal: stopSignalOf(ctx) });
|
|
189
|
+
/** A step: the messages steered to the turn go into the next request, after the tools' results. */
|
|
190
|
+
const step = async () => {
|
|
191
|
+
if ((await takeSteers(ctx, conversation)).length === 0)
|
|
192
|
+
return;
|
|
193
|
+
// The runner leaves the history to its caller, who changed it: the reply, its results and the messages.
|
|
194
|
+
runner.setMessagesParams((params) => ({ ...params, messages: sendable(conversation.history()) }));
|
|
195
|
+
};
|
|
196
|
+
// A reply whose tools did not finish (a crash): run them, with the same
|
|
197
|
+
// ids, once the calls whose results are stored are settled, as for any
|
|
198
|
+
// reply: else one of its calls could take the id of an identical call
|
|
199
|
+
// answered before.
|
|
200
|
+
if (turn.openCalls().length > 0) {
|
|
201
|
+
await toolCallStarted(ctx);
|
|
202
|
+
const results = await runner.generateToolResponse();
|
|
203
|
+
check();
|
|
204
|
+
if (results) {
|
|
205
|
+
await turn.append(results);
|
|
206
|
+
runner.pushMessages(results);
|
|
207
|
+
}
|
|
208
|
+
await toolCallEnded(ctx);
|
|
209
|
+
await step();
|
|
105
210
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
211
|
+
let paused = false;
|
|
212
|
+
for await (const message of runner) {
|
|
213
|
+
// A reply that cannot go on ends the turn, whose tool calls do not run.
|
|
214
|
+
const stopped = stoppedShort(message, maxTokens);
|
|
215
|
+
if (stopped)
|
|
216
|
+
throw new restate.TerminalError(stopped);
|
|
217
|
+
const said = { role: 'assistant', content: message.content };
|
|
218
|
+
// Paused (a server tool's long turn): a step of the turn, not a reply to
|
|
219
|
+
// end it with, and the model goes on from it.
|
|
220
|
+
if (message.stop_reason === 'pause_turn') {
|
|
221
|
+
await turn.append(said);
|
|
222
|
+
paused = true;
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
await turn.appendReply([said]);
|
|
226
|
+
if (!message.content.some((c) => c.type === 'tool_use'))
|
|
227
|
+
return textOf(message.content);
|
|
228
|
+
await toolCallStarted(ctx);
|
|
229
|
+
const results = await runner.generateToolResponse();
|
|
230
|
+
check();
|
|
231
|
+
if (results)
|
|
232
|
+
await turn.append(results);
|
|
233
|
+
await toolCallEnded(ctx);
|
|
234
|
+
await step();
|
|
109
235
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
await toolCallStarted(ctx);
|
|
113
|
-
const results = await runner.generateToolResponse();
|
|
114
|
-
check();
|
|
115
|
-
if (results)
|
|
116
|
-
await conversation.append(id, [results]);
|
|
117
|
-
await toolCallEnded(ctx);
|
|
236
|
+
if (!paused)
|
|
237
|
+
throw new Error('the tool runner ended without a reply');
|
|
118
238
|
}
|
|
119
|
-
}
|
|
239
|
+
};
|
|
120
240
|
/**
|
|
121
241
|
* Why the model's `message` stopped short of a reply to go on from: cut off
|
|
122
|
-
* at `maxTokens` (its text, or a tool call's input, unfinished), or
|
|
242
|
+
* at `maxTokens` (its text, or a tool call's input, unfinished), declined, or
|
|
243
|
+
* past the model's context window: a terminal error's message.
|
|
123
244
|
*/
|
|
124
245
|
function stoppedShort(message, maxTokens) {
|
|
125
246
|
if (message.stop_reason === 'max_tokens') {
|
|
126
|
-
return {
|
|
127
|
-
text: `Cut off: the reply reached ${maxTokens} tokens before it ended.`,
|
|
128
|
-
error: `the model's reply reached maxTokens (${maxTokens}) before it ended: raise the agent's maxTokens`,
|
|
129
|
-
};
|
|
247
|
+
return `the model's reply reached maxTokens (${maxTokens}) before it ended: raise the agent's maxTokens`;
|
|
130
248
|
}
|
|
131
249
|
if (message.stop_reason === 'refusal') {
|
|
132
250
|
const category = message.stop_details?.category;
|
|
133
|
-
return {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
251
|
+
return `the model declined to answer${category ? ` (${category})` : ''}`;
|
|
252
|
+
}
|
|
253
|
+
if (message.stop_reason === 'model_context_window_exceeded') {
|
|
254
|
+
return "the conversation outgrew the model's context window: lower the agent's window or budget";
|
|
137
255
|
}
|
|
138
256
|
return undefined;
|
|
139
257
|
}
|
|
@@ -146,71 +264,47 @@ const native = (t, ctx) => ({
|
|
|
146
264
|
parse: (args) => args,
|
|
147
265
|
run: (args, context) => t.run(args, { ctx, callId: callId(context) }),
|
|
148
266
|
});
|
|
149
|
-
/**
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
267
|
+
/**
|
|
268
|
+
* The Claude models with structured outputs: of each family, the 4.5 models
|
|
269
|
+
* and later (and Mythos Preview); not Claude 3, Opus 4 and 4.1, or Sonnet 4.
|
|
270
|
+
*/
|
|
271
|
+
const STRUCTURED_OUTPUTS = /claude-(?:(?:opus|sonnet|haiku)-4-[5-9](?!\d)|(?:opus|sonnet|haiku|fable|mythos)-(?:[5-9]|[1-9]\d)|mythos-preview)/;
|
|
272
|
+
/** Whether an agent of `options` asks the model for its `output` natively (see `nativeOutput`). */
|
|
273
|
+
const asksNatively = ({ model, output, nativeOutput }) => output !== undefined &&
|
|
274
|
+
(nativeOutput ?? STRUCTURED_OUTPUTS.test(modelIdOf(modelOf(model, CLAUDE_MODEL), 'anthropic')));
|
|
275
|
+
/**
|
|
276
|
+
* `output`'s JSON schema, as the API takes it (the SDK's helper's): what the
|
|
277
|
+
* API does not take (a string's `minLength`, say) goes to a description, and
|
|
278
|
+
* is left to the check of the reply.
|
|
279
|
+
*/
|
|
280
|
+
const formatOf = (output) => {
|
|
281
|
+
const { type, schema } = betaZodOutputFormat(output);
|
|
282
|
+
return { type, schema };
|
|
283
|
+
};
|
|
284
|
+
/** The client of an agent without one of its own, on the context of the turn it answers. */
|
|
285
|
+
const CLIENT = new ScopeKey('the Anthropic client');
|
|
286
|
+
/** The agent of `options`, for the turn of `ctx`. */
|
|
287
|
+
const agentOf = (ctx, options) => {
|
|
288
|
+
const { model, system, tools = [], client, maxTokens = 16_000, effort, output } = options;
|
|
289
|
+
return {
|
|
290
|
+
client: client ?? CLIENT.of(ctx, () => new Anthropic()),
|
|
291
|
+
model: modelIdOf(modelOf(model, CLAUDE_MODEL), 'anthropic'),
|
|
157
292
|
maxTokens,
|
|
158
293
|
effort,
|
|
159
294
|
system,
|
|
160
295
|
tools: tools.map((t) => (isTool(t) ? native(t, ctx) : t)),
|
|
296
|
+
...(output !== undefined && asksNatively(options) ? { format: formatOf(output) } : {}),
|
|
161
297
|
};
|
|
162
|
-
const id = nextPromptId(ctx);
|
|
163
|
-
const conversation = await Conversation.open(ctx.db);
|
|
164
|
-
for (;;) {
|
|
165
|
-
const answer = await conversation.answer(id);
|
|
166
|
-
if (answer !== undefined)
|
|
167
|
-
return storedAnswer(answer);
|
|
168
|
-
// Finish an interrupted prompt first (this one's, after a crash), then
|
|
169
|
-
// start this one.
|
|
170
|
-
let pending = await conversation.pending();
|
|
171
|
-
if (pending === undefined) {
|
|
172
|
-
await conversation.append(id, [{ role: 'user', content: text }]);
|
|
173
|
-
pending = id;
|
|
174
|
-
}
|
|
175
|
-
const turn = stopSignalOf(ctx);
|
|
176
|
-
try {
|
|
177
|
-
const running = run(ctx, agent, conversation, pending, turn);
|
|
178
|
-
running.catch(() => { });
|
|
179
|
-
await (turn ? Promise.race([running, aborted(turn)]) : running);
|
|
180
|
-
}
|
|
181
|
-
catch (error) {
|
|
182
|
-
// The attempt ended: it stops, and the next attempt goes on with the prompt.
|
|
183
|
-
if (turn?.reason instanceof AttemptEnded)
|
|
184
|
-
throw turn.reason;
|
|
185
|
-
// Cancelled: the prompt ends, and the next one starts afresh.
|
|
186
|
-
if (turn?.aborted || error instanceof restate.CancelledError) {
|
|
187
|
-
await conversation.cancel(pending, CANCELLED);
|
|
188
|
-
throw turn?.aborted ? turn.reason : error;
|
|
189
|
-
}
|
|
190
|
-
// An earlier prompt that ended (cut off, or declined): this one goes on.
|
|
191
|
-
if (pending !== id &&
|
|
192
|
-
error instanceof restate.TerminalError &&
|
|
193
|
-
(await conversation.answer(pending)) !== undefined) {
|
|
194
|
-
continue;
|
|
195
|
-
}
|
|
196
|
-
// Refused for good (a wrong API key): the prompt ends unanswered, and
|
|
197
|
-
// fails as terminal. An earlier one's, this one goes on.
|
|
198
|
-
const refused = refusal(error);
|
|
199
|
-
if (!refused)
|
|
200
|
-
throw error;
|
|
201
|
-
await conversation.close(pending, UNANSWERED);
|
|
202
|
-
if (pending === id)
|
|
203
|
-
throw refused;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
298
|
};
|
|
207
299
|
/**
|
|
208
300
|
* Answer `text`, once: a retried attempt resumes the same prompt. Each prompt
|
|
209
301
|
* of an invocation is a prompt of its own.
|
|
210
302
|
* With `output`, it answers with the value the agent replies with (see
|
|
211
|
-
* output.ts), not its text
|
|
303
|
+
* output.ts), not its text: a reply that is not one is asked again within
|
|
304
|
+
* its turn, once. A model with structured outputs is asked for it natively
|
|
305
|
+
* (`nativeOutput`), else in the prompt.
|
|
212
306
|
*/
|
|
213
|
-
export const prompt = (ctx, text, options = {}) =>
|
|
307
|
+
export const prompt = async (ctx, text, options = {}) => withChecked(text, options, (t, o, check, reminder) => answerOnce(ctx, t, items, runOf(ctx, agentOf(ctx, o)), { check, reminder }), asksNatively(options));
|
|
214
308
|
/**
|
|
215
309
|
* A chat handler: each message an invocation, the conversation in the
|
|
216
310
|
* object's database, with `options`, or the options a function of the
|
|
@@ -220,49 +314,37 @@ export const prompt = (ctx, text, options = {}) => withOutput(text, options, (t,
|
|
|
220
314
|
export const chat = (options = {}) => {
|
|
221
315
|
if (typeof options === 'object')
|
|
222
316
|
modelIdOf(modelOf(options.model, CLAUDE_MODEL), 'anthropic');
|
|
223
|
-
return chatHandler(async (ctx, message) => prompt(ctx, message, await configured(options, ctx)));
|
|
317
|
+
return chatHandler(async (ctx, message) => prompt(ctx, message, await configured(options, ctx)), { steers: true });
|
|
224
318
|
};
|
|
225
|
-
/** The text of stored content, without its tool calls and results. */
|
|
226
|
-
const storedText = (content) => typeof content === 'string' ? content : (content ?? []).flatMap((b) => (b.type === 'text' ? [b.text] : [])).join('');
|
|
227
319
|
/**
|
|
228
|
-
* A
|
|
229
|
-
*
|
|
230
|
-
*
|
|
320
|
+
* A view of the conversation as clients read it: a page at a time, or what
|
|
321
|
+
* is new or changed since a cursor; `view: 'summary'` for each turn's
|
|
322
|
+
* message and answer. It answers while a message is answered.
|
|
231
323
|
*/
|
|
232
|
-
export const messages = () =>
|
|
324
|
+
export const messages = () => conversationView(items);
|
|
233
325
|
/**
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
326
|
+
* How an agent of `options` summarizes the earliest turns, past its budget:
|
|
327
|
+
* with its own client and model (`agent()` gives it; for an object of your
|
|
328
|
+
* own, `sessionObject`'s `summarize`).
|
|
237
329
|
*/
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
if (m.role === 'system')
|
|
247
|
-
continue;
|
|
248
|
-
transcript.say(m.role, storedText(m.content));
|
|
249
|
-
if (typeof m.content === 'string')
|
|
250
|
-
continue;
|
|
251
|
-
for (const block of m.content) {
|
|
252
|
-
if (block.type === 'tool_use')
|
|
253
|
-
transcript.call(block.id, block.name, block.input);
|
|
254
|
-
if (block.type === 'tool_result')
|
|
255
|
-
transcript.result(block.tool_use_id, storedText(block.content), block.is_error === true);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
return transcript;
|
|
330
|
+
export const summarizer = (options = {}) => async (ctx, request) => {
|
|
331
|
+
const { client, model, maxTokens } = agentOf(ctx, { ...options, tools: [] });
|
|
332
|
+
const message = await client.beta.messages.create({
|
|
333
|
+
model,
|
|
334
|
+
max_tokens: maxTokens,
|
|
335
|
+
messages: [{ role: 'user', content: request }],
|
|
336
|
+
});
|
|
337
|
+
return textOf(message.content);
|
|
259
338
|
};
|
|
260
339
|
/** An agent: a virtual object `name`, one per key, whose `chat` handler is {@link chat}, and `messages` {@link messages}. */
|
|
261
|
-
export const agent = ({ name, description, schema, background, ...options }) => sessionObject({
|
|
340
|
+
export const agent = ({ name, description, schema, background, window, budget, summarize, ...options }) => sessionObject({
|
|
262
341
|
name,
|
|
263
342
|
description,
|
|
264
343
|
schema,
|
|
265
344
|
background,
|
|
345
|
+
window,
|
|
346
|
+
budget,
|
|
347
|
+
summarize: summarize ?? summarizer(options),
|
|
266
348
|
handlers: { chat: chat(options) },
|
|
267
349
|
views: { messages: messages() },
|
|
268
350
|
});
|
package/dist/claude/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/claude/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,4EAA4E;AAC5E,2CAA2C;AAC3C,EAAE;AACF,wGAAwG;AACxG,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,uEAAuE;AACvE,EAAE;AACF,4EAA4E;AAC5E,0BAA0B;AAC1B,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,+EAA+E;AAC/E,4EAA4E;AAC5E,oDAAoD;AACpD,4EAA4E;AAC5E,wDAAwD;AACxD,6EAA6E;AAC7E,0DAA0D;AAC1D,2EAA2E;AAC3E,mEAAmE;AACnE,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAEhD,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EACL,OAAO,EACP,YAAY,EACZ,SAAS,EACT,WAAW,EACX,YAAY,EAEZ,UAAU,EACV,QAAQ,EACR,eAAe,EACf,SAAS,EACT,OAAO,EACP,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,eAAe,EACf,YAAY,EACZ,UAAU,EACV,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAe,UAAU,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAmB,aAAa,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,YAAY,EAAwB,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,m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AC,gBAAgB,CAAC,KAAK,CAAC,CAAC;AAEtD;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GACrB,CAAC,OAAO,GAAY,EAAE,EAAa,EAAE,CACrC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7E,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAChD,KAAK;QACL,UAAU,EAAE,SAAS;QACrB,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;KAC/C,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC,CAAC;AAEJ,6HAA6H;AAC7H,MAAM,CAAC,MAAM,KAAK,GAAG,CAAkE,EACrF,IAAI,EACJ,WAAW,EACX,MAAM,EACN,UAAU,EACV,MAAM,EACN,MAAM,EACN,SAAS,EACT,GAAG,OAAO,EACiB,EAAE,EAAE,CAC/B,aAAa,CAAC;IACZ,IAAI;IACJ,WAAW;IACX,MAAM;IACN,UAAU;IACV,MAAM;IACN,MAAM;IACN,SAAS,EAAE,SAAS,IAAI,UAAU,CAAC,OAAO,CAAC;IAC3C,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;IACjC,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE;CAChC,CAAC,CAAC"}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import * as clients from '@restatedev/restate-sdk-clients';
|
|
2
2
|
import type { VirtualObjectDefinition } from '@restatedev/restate-sdk-core';
|
|
3
|
-
import type { ChatMessage, Messages, MessagesRequest, Part
|
|
3
|
+
import type { Answering, ChatMessage, Messages, MessagesRequest, Part } from './common.ts';
|
|
4
4
|
import type { Status, Stopped, Synced, SyncRequest } from './object.ts';
|
|
5
|
-
import type { Notifications, Resolved, Signal, Waiting, Watch } from './signals.ts';
|
|
6
|
-
export type { ChatMessage, Messages, MessagesRequest, Notifications, Part, Resolved, Signal, Status, Stopped, Synced, SyncRequest,
|
|
5
|
+
import type { Notifications, Resolved, Signal, Steered, Steering, Waiting, Watch } from './signals.ts';
|
|
6
|
+
export type { Answering, ChatMessage, Messages, MessagesRequest, Notifications, Part, Resolved, Signal, Status, Steered, Steering, Stopped, Synced, SyncRequest, Waiting, Watch, };
|
|
7
7
|
/** The handlers of an agent (`agent()` of any framework), as Restate's client calls them. */
|
|
8
8
|
export interface Agent {
|
|
9
9
|
/** Answer `message`. */
|
|
10
10
|
chat(ctx: unknown, message: string): Promise<string>;
|
|
11
|
+
/**
|
|
12
|
+
* Send `message` while the agent answers another: the turn being answered
|
|
13
|
+
* takes it at its next step (once its model's tool calls have their
|
|
14
|
+
* results), and its answer covers it; else it is answered as a turn of its
|
|
15
|
+
* own, after the messages before it. Either way it is answered once: send
|
|
16
|
+
* it with an idempotency key, made once per message, so that sending it
|
|
17
|
+
* again is the same message.
|
|
18
|
+
*/
|
|
19
|
+
steer(ctx: unknown, message: string): Promise<Steered>;
|
|
11
20
|
/** The conversation, a page at a time, or what is new or changed since a cursor, also while a message is answered. */
|
|
12
21
|
messages(ctx: unknown, request?: MessagesRequest): Promise<Messages>;
|
|
13
22
|
/** The conversation since a cursor, the status and the revision; with `revision`, once there is a newer one. */
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CA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AAEhB,sDAAsD;AACtD,MAAM,WAAW,aAAa;IAC5B,4GAA4G;IAC5G,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6EAA6E;IAC7E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AA8BD;;;;;;;;;;GAUG;AACH,wBAAuB,MAAM,CAC3B,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,UAAU,EAAE,uBAAuB,CAAC,MAAM,EAAE,KAAK,CAAC,EAClD,GAAG,EAAE,MAAM,EACX,EAAE,MAAU,EAAE,MAAM,EAAE,cAAmB,EAAE,GAAE,aAAkB,GAC9D,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAoBtC"}
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,yEAAyE;AACzE,6EAA6E;AAC7E,uBAAuB;AACvB,EAAE;AACF,gEAAgE;AAChE,+DAA+D;AAC/D,EAAE;AACF,uEAAuE;AACvE,qEAAqE;AACrE,8DAA8D;AAC9D,mGAAmG;AACnG,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,yEAAyE;AACzE,6EAA6E;AAC7E,uBAAuB;AACvB,EAAE;AACF,gEAAgE;AAChE,+DAA+D;AAC/D,EAAE;AACF,uEAAuE;AACvE,qEAAqE;AACrE,8DAA8D;AAC9D,mGAAmG;AACnG,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC;AA0D3D;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAuC,IAAO,EA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