obol-ai 0.2.19 → 0.2.21
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 +8 -0
- package/bin/obol.js +8 -0
- package/package.json +1 -1
- package/src/claude/chat.js +8 -8
- package/src/claude/client.js +7 -2
- package/src/claude/constants.js +1 -1
- package/src/cli/config.js +1 -1
- package/src/cli/reauth.js +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 0.2.21
|
|
2
|
+
- add obol reauth command and fix bailout/summary to use streaming
|
|
3
|
+
- update changelog
|
|
4
|
+
|
|
5
|
+
## 0.2.20
|
|
6
|
+
- increase tool iterations to 100 and max tokens to 128K
|
|
7
|
+
- update changelog
|
|
8
|
+
|
|
1
9
|
## 0.2.19
|
|
2
10
|
- add location, venue, contact, poll message support
|
|
3
11
|
- update changelog
|
package/bin/obol.js
CHANGED
|
@@ -86,4 +86,12 @@ program
|
|
|
86
86
|
await deleteAll();
|
|
87
87
|
});
|
|
88
88
|
|
|
89
|
+
program
|
|
90
|
+
.command('reauth')
|
|
91
|
+
.description('Re-authenticate with Anthropic OAuth')
|
|
92
|
+
.action(async () => {
|
|
93
|
+
const { reauth } = require('../src/cli/reauth');
|
|
94
|
+
await reauth();
|
|
95
|
+
});
|
|
96
|
+
|
|
89
97
|
program.parse();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "obol-ai",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21",
|
|
4
4
|
"description": "Self-evolving AI assistant that learns, remembers, and acts on its own. Persistent vector memory, self-rewriting personality, proactive heartbeats.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
package/src/claude/chat.js
CHANGED
|
@@ -120,7 +120,7 @@ function createClaude(anthropicConfig, { personality, memory, userDir = OBOL_DIR
|
|
|
120
120
|
const toolDefs = runnableTools.map(({ run, ...def }) => def);
|
|
121
121
|
const probe = await client.messages.create({
|
|
122
122
|
model: activeModel,
|
|
123
|
-
max_tokens:
|
|
123
|
+
max_tokens: 1024,
|
|
124
124
|
system: systemPrompt,
|
|
125
125
|
messages: withCacheBreakpoints([...history]),
|
|
126
126
|
tools: toolDefs,
|
|
@@ -141,7 +141,7 @@ function createClaude(anthropicConfig, { personality, memory, userDir = OBOL_DIR
|
|
|
141
141
|
|
|
142
142
|
const runner = client.beta.messages.toolRunner({
|
|
143
143
|
model: activeModel,
|
|
144
|
-
max_tokens:
|
|
144
|
+
max_tokens: 131072,
|
|
145
145
|
system: systemPrompt,
|
|
146
146
|
messages: withCacheBreakpoints([...history]),
|
|
147
147
|
tools: runnableTools.length > 0 ? runnableTools : undefined,
|
|
@@ -167,9 +167,9 @@ function createClaude(anthropicConfig, { personality, memory, userDir = OBOL_DIR
|
|
|
167
167
|
...bailoutResults,
|
|
168
168
|
{ type: 'text', text: 'You have used too many tool calls. Please provide a final response now based on what you have so far.' },
|
|
169
169
|
]);
|
|
170
|
-
const bailoutResponse = await client.messages.
|
|
171
|
-
model: activeModel, max_tokens:
|
|
172
|
-
}, { signal: abortController.signal });
|
|
170
|
+
const bailoutResponse = await client.messages.stream({
|
|
171
|
+
model: activeModel, max_tokens: 131072, system: systemPrompt, messages: withCacheBreakpoints([...histories.get(chatId)]),
|
|
172
|
+
}, { signal: abortController.signal }).finalMessage();
|
|
173
173
|
histories.pushAssistant(chatId, bailoutResponse.content);
|
|
174
174
|
trackUsage(bailoutResponse.usage);
|
|
175
175
|
const text = bailoutResponse.content.filter(b => b.type === 'text').map(b => b.text).join('\n');
|
|
@@ -181,9 +181,9 @@ function createClaude(anthropicConfig, { personality, memory, userDir = OBOL_DIR
|
|
|
181
181
|
if (!text.trim() && newMessages.length > 1) {
|
|
182
182
|
vlog('[claude] No text in final response after tool use — forcing summary');
|
|
183
183
|
histories.pushUser(chatId, 'Provide a concise response to the user based on the tool results above.');
|
|
184
|
-
const summaryResponse = await client.messages.
|
|
185
|
-
model: activeModel, max_tokens:
|
|
186
|
-
}, { signal: abortController.signal });
|
|
184
|
+
const summaryResponse = await client.messages.stream({
|
|
185
|
+
model: activeModel, max_tokens: 131072, system: systemPrompt, messages: withCacheBreakpoints([...histories.get(chatId)]),
|
|
186
|
+
}, { signal: abortController.signal }).finalMessage();
|
|
187
187
|
histories.pushAssistant(chatId, summaryResponse.content);
|
|
188
188
|
trackUsage(summaryResponse.usage);
|
|
189
189
|
text = summaryResponse.content.filter(b => b.type === 'text').map(b => b.text).join('\n');
|
package/src/claude/client.js
CHANGED
|
@@ -9,12 +9,17 @@ function createAnthropicClient(anthropicConfig, { useOAuth = true } = {}) {
|
|
|
9
9
|
authToken: anthropicConfig.oauth.accessToken,
|
|
10
10
|
defaultHeaders: {
|
|
11
11
|
'anthropic-dangerous-direct-browser-access': 'true',
|
|
12
|
-
'anthropic-beta': 'claude-code-20250219,oauth-2025-04-20',
|
|
12
|
+
'anthropic-beta': 'claude-code-20250219,oauth-2025-04-20,output-128k-2025-02-19',
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
if (anthropicConfig.apiKey) {
|
|
17
|
-
return new Anthropic({
|
|
17
|
+
return new Anthropic({
|
|
18
|
+
apiKey: anthropicConfig.apiKey,
|
|
19
|
+
defaultHeaders: {
|
|
20
|
+
'anthropic-beta': 'output-128k-2025-02-19',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
18
23
|
}
|
|
19
24
|
throw new Error('No Anthropic credentials configured. Run: obol config');
|
|
20
25
|
}
|
package/src/claude/constants.js
CHANGED
package/src/cli/config.js
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const { loadConfig } = require('../config');
|
|
2
|
+
const { runOAuthFlow } = require('./config');
|
|
3
|
+
|
|
4
|
+
async function reauth() {
|
|
5
|
+
const cfg = loadConfig({ resolve: false });
|
|
6
|
+
if (!cfg) {
|
|
7
|
+
console.log('\n No config found. Run "obol init" first.\n');
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
await runOAuthFlow(cfg);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
module.exports = { reauth };
|