@pasko70/pibo 3.1.1 → 3.1.2
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.
|
@@ -182,7 +182,7 @@ export class OutputRenderSequencer {
|
|
|
182
182
|
if (!latest) {
|
|
183
183
|
invocation = this.createToolInvocation(invocations, event.piboSessionId, eventId, event.toolCallId, transition);
|
|
184
184
|
}
|
|
185
|
-
else if (event.type === "tool_call" && (latest
|
|
185
|
+
else if (event.type === "tool_call" && toolCallStartsNewInvocation(latest, transition?.callFingerprint)) {
|
|
186
186
|
invocation = this.createToolInvocation(invocations, event.piboSessionId, eventId, event.toolCallId, transition);
|
|
187
187
|
}
|
|
188
188
|
else if (event.type === "tool_execution_started" && latest.closed && latest.seen.has("tool_execution_started")) {
|
|
@@ -195,6 +195,8 @@ export class OutputRenderSequencer {
|
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
invocation.seen.add(event.type);
|
|
198
|
+
if (event.type === "tool_call" && transition?.callFingerprint)
|
|
199
|
+
invocation.callFingerprint = transition.callFingerprint;
|
|
198
200
|
if (event.type === "tool_execution_finished")
|
|
199
201
|
invocation.closed = true;
|
|
200
202
|
this.trimToolInvocations(state);
|
|
@@ -295,6 +297,15 @@ function createInvocation(invocations, ordinal) {
|
|
|
295
297
|
invocations.push(invocation);
|
|
296
298
|
return invocation;
|
|
297
299
|
}
|
|
300
|
+
function toolCallStartsNewInvocation(invocation, callFingerprint) {
|
|
301
|
+
if (!invocation.seen.has("tool_call"))
|
|
302
|
+
return invocation.closed && invocation.persistedIdentity;
|
|
303
|
+
if (invocation.closed)
|
|
304
|
+
return true;
|
|
305
|
+
if (invocation.callFingerprint === undefined)
|
|
306
|
+
return false;
|
|
307
|
+
return callFingerprint === undefined || invocation.callFingerprint !== callFingerprint;
|
|
308
|
+
}
|
|
298
309
|
function outputPartTransition(event, activeEventId) {
|
|
299
310
|
const eventId = ("eventId" in event ? event.eventId : undefined) ?? activeEventId;
|
|
300
311
|
if (!eventId)
|
|
@@ -425,6 +436,8 @@ function toolInvocationCounterKey(eventId, toolCallId) {
|
|
|
425
436
|
return JSON.stringify([eventId ?? "unscoped", toolCallId]);
|
|
426
437
|
}
|
|
427
438
|
function toolCallFingerprint(event) {
|
|
439
|
+
if (!event.argsComplete)
|
|
440
|
+
return undefined;
|
|
428
441
|
return createHash("sha256")
|
|
429
442
|
.update(JSON.stringify([event.toolName, event.argsComplete, event.args]))
|
|
430
443
|
.digest("hex");
|
|
@@ -255,7 +255,9 @@ export class PiboDataSessionStore {
|
|
|
255
255
|
let ordinal;
|
|
256
256
|
if (input.eventType === "tool_call"
|
|
257
257
|
&& latestOpen
|
|
258
|
-
&& (latestOpen.seen_call === 0
|
|
258
|
+
&& (latestOpen.seen_call === 0
|
|
259
|
+
|| latestOpen.call_fingerprint === null
|
|
260
|
+
|| latestOpen.call_fingerprint === input.callFingerprint)) {
|
|
259
261
|
ordinal = latestOpen.invocation_ordinal;
|
|
260
262
|
}
|
|
261
263
|
else if (input.eventType !== "tool_call" && latestOpen) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pasko70/pibo",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@pasko70/pibo",
|
|
9
|
-
"version": "3.1.
|
|
9
|
+
"version": "3.1.2",
|
|
10
10
|
"workspaces": [
|
|
11
11
|
"packages/workflows"
|
|
12
12
|
],
|