@ouro.bot/cli 0.1.0-alpha.992 → 0.1.0-alpha.993

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.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.993",
6
+ "changes": [
7
+ "An agent's reply on Anthropic no longer turns into an earlier note when its answer contains a bracket or a brace: streamed tool arguments stay intact."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.992",
6
12
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.992",
2
+ "runtimeVersion": "0.1.0-alpha.993",
3
3
  "bundleSchemaVersion": 3,
4
4
  "lastUpdated": "2026-09-03T00:00:00.000Z"
5
5
  }
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0"?>
2
2
  <Container version="2">
3
3
  <Name>ouro-butler</Name>
4
- <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.992</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.993</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -204,19 +204,30 @@ function toAnthropicUsage(raw) {
204
204
  total_tokens: totalInputTokens + outputTokens,
205
205
  };
206
206
  }
207
+ function parsesAsJson(text) {
208
+ try {
209
+ return JSON.parse(text);
210
+ }
211
+ catch {
212
+ return undefined;
213
+ }
214
+ }
207
215
  function mergeAnthropicToolArguments(current, partial) {
208
216
  if (!partial)
209
217
  return current;
210
- const trimmedCurrent = current.trim();
218
+ // Restart and merge only apply while the text so far is a complete JSON value (the
219
+ // block's starting input). Mid-stream, a fragment may legitimately start with "{" or
220
+ // "[", or the text so far may end in "}", inside a string: those fragments append.
221
+ const completed = parsesAsJson(current);
211
222
  const trimmedPartial = partial.trim();
212
223
  // If streaming restarts with a full JSON object/array fragment, trust it.
213
- if (trimmedPartial.startsWith("{") || trimmedPartial.startsWith("[")) {
224
+ if (completed !== undefined && (trimmedPartial.startsWith("{") || trimmedPartial.startsWith("["))) {
214
225
  return partial;
215
226
  }
216
227
  // Anthropic can emit block.input as a complete object and then emit
217
228
  // additional members as ',\"k\":v' deltas; merge those safely.
218
- if (trimmedCurrent.startsWith("{") && trimmedCurrent.endsWith("}")) {
219
- const inner = trimmedCurrent.slice(1, -1).trim();
229
+ if (completed !== null && typeof completed === "object" && !Array.isArray(completed)) {
230
+ const inner = current.trim().slice(1, -1).trim();
220
231
  let suffix = partial;
221
232
  if (!inner && suffix.startsWith(",")) {
222
233
  suffix = suffix.slice(1);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.992",
3
+ "version": "0.1.0-alpha.993",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@ouro.bot/cli",
9
- "version": "0.1.0-alpha.992",
9
+ "version": "0.1.0-alpha.993",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.78.0",
12
12
  "@azure/identity": "^4.13.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.992",
3
+ "version": "0.1.0-alpha.993",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },