@rynfar/meridian 1.48.0 → 1.48.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.
|
@@ -10168,6 +10168,38 @@ function consolidateMultimodalOntoLastUser(structured) {
|
|
|
10168
10168
|
return result;
|
|
10169
10169
|
}
|
|
10170
10170
|
var TOOL_TARGET_KEYS = ["filePath", "file_path", "path", "command", "pattern", "query", "url"];
|
|
10171
|
+
var CONTENT_SUMMARY_MAX = 120;
|
|
10172
|
+
function summarizeContent(value) {
|
|
10173
|
+
if (typeof value !== "string" || value.length === 0)
|
|
10174
|
+
return;
|
|
10175
|
+
const collapsed = value.replace(/\s+/g, " ").trim();
|
|
10176
|
+
if (!collapsed)
|
|
10177
|
+
return;
|
|
10178
|
+
return collapsed.length > CONTENT_SUMMARY_MAX ? collapsed.slice(0, CONTENT_SUMMARY_MAX) + "..." : collapsed;
|
|
10179
|
+
}
|
|
10180
|
+
function extractContentSummary(name, input) {
|
|
10181
|
+
if (!input || typeof input !== "object")
|
|
10182
|
+
return;
|
|
10183
|
+
const rec = input;
|
|
10184
|
+
switch (name.toLowerCase()) {
|
|
10185
|
+
case "edit":
|
|
10186
|
+
return summarizeContent(rec.newString ?? rec.new_string);
|
|
10187
|
+
case "write":
|
|
10188
|
+
return summarizeContent(rec.content);
|
|
10189
|
+
case "multiedit": {
|
|
10190
|
+
const edits = rec.edits;
|
|
10191
|
+
if (!Array.isArray(edits) || edits.length === 0)
|
|
10192
|
+
return;
|
|
10193
|
+
const first = edits[0];
|
|
10194
|
+
const firstSummary = summarizeContent(first?.newString ?? first?.new_string);
|
|
10195
|
+
if (!firstSummary)
|
|
10196
|
+
return;
|
|
10197
|
+
return edits.length > 1 ? `${edits.length} edits; first: ${firstSummary}` : firstSummary;
|
|
10198
|
+
}
|
|
10199
|
+
default:
|
|
10200
|
+
return;
|
|
10201
|
+
}
|
|
10202
|
+
}
|
|
10171
10203
|
function buildToolUseIndex(messages) {
|
|
10172
10204
|
const index = new Map;
|
|
10173
10205
|
for (const m of messages) {
|
|
@@ -10187,13 +10219,18 @@ function buildToolUseIndex(messages) {
|
|
|
10187
10219
|
}
|
|
10188
10220
|
}
|
|
10189
10221
|
}
|
|
10190
|
-
index.set(block.id, {
|
|
10222
|
+
index.set(block.id, {
|
|
10223
|
+
name: block.name,
|
|
10224
|
+
target,
|
|
10225
|
+
contentSummary: extractContentSummary(block.name, input)
|
|
10226
|
+
});
|
|
10191
10227
|
}
|
|
10192
10228
|
}
|
|
10193
10229
|
return index;
|
|
10194
10230
|
}
|
|
10195
10231
|
function describeToolCall(info) {
|
|
10196
|
-
|
|
10232
|
+
const head = info.target ? `your ${info.name} ${info.target}` : `your ${info.name}`;
|
|
10233
|
+
return info.contentSummary ? `[${head} → "${info.contentSummary}"]` : `[${head}]`;
|
|
10197
10234
|
}
|
|
10198
10235
|
|
|
10199
10236
|
// src/proxy/auth.ts
|
package/dist/cli.js
CHANGED
package/dist/proxy/messages.d.ts
CHANGED
|
@@ -81,6 +81,15 @@ export interface ToolCallInfo {
|
|
|
81
81
|
name: string;
|
|
82
82
|
/** Compact human-readable target (file path, command, pattern...), if any. */
|
|
83
83
|
target: string | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* For mutating tools (edit/write/multiedit): a truncated summary of the
|
|
86
|
+
* content the call produced. On fresh replay the assistant's tool_use
|
|
87
|
+
* blocks are dropped, so without this the model knows THAT it edited a
|
|
88
|
+
* file but not WHAT it wrote — it then re-derives near-duplicate edits
|
|
89
|
+
* and confabulates a parallel editor when it doesn't recognize its own
|
|
90
|
+
* wording (#496 follow-up, stefanpartheym's transcript).
|
|
91
|
+
*/
|
|
92
|
+
contentSummary: string | undefined;
|
|
84
93
|
}
|
|
85
94
|
/**
|
|
86
95
|
* Index every assistant tool_use block in a conversation by id.
|
|
@@ -98,10 +107,12 @@ export declare function buildToolUseIndex(messages: Array<{
|
|
|
98
107
|
}>): Map<string, ToolCallInfo>;
|
|
99
108
|
/**
|
|
100
109
|
* Render a compact attribution label for a replayed tool result, e.g.
|
|
101
|
-
* `[write tmp/test2.txt]
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
110
|
+
* `[write tmp/test2.txt]`, `[bash echo hi]`, or — for mutating tools —
|
|
111
|
+
* `[edit a.yml → "# Ignore major bumps..."]` so the model can recognize its
|
|
112
|
+
* own prior work product on replay. Deliberately terse and bracket-formatted
|
|
113
|
+
* differently from the banned `[Tool Use: ...]` / `[Tool Result ...]` shapes
|
|
114
|
+
* (#111/#386) so the model reads it as context, not as tool-call syntax to
|
|
115
|
+
* imitate.
|
|
105
116
|
*/
|
|
106
117
|
export declare function describeToolCall(info: ToolCallInfo): string;
|
|
107
118
|
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/proxy/messages.ts"],"names":[],"mappings":"AAAA;;GAEG;AAcH;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,GAAG,GAAG,MAAM,CAiBrD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAUtE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAM7D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,GAAG,CAAA;CAAE,CAAC,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,GAAG,CAAA;CAAE,CAAC,CAKzH;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAU3D;AAED,yEAAyE;AACzE,eAAO,MAAM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