@hheei/pi-ext-ui 0.4.1 → 0.4.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.
- package/dist/nested-calls-view.js +1 -0
- package/dist/renderer.js +19 -6
- package/package.json +1 -1
package/dist/renderer.js
CHANGED
|
@@ -53,7 +53,8 @@ function resolveToolCallSummary(params) {
|
|
|
53
53
|
// Tier 1: Host Native RenderCall Delegation
|
|
54
54
|
if (originalRenderCall !== undefined) {
|
|
55
55
|
try {
|
|
56
|
-
const
|
|
56
|
+
const upstreamContext = { ...context, lastComponent: undefined };
|
|
57
|
+
const upstreamLines = originalRenderCall(args, theme, upstreamContext).render(120);
|
|
57
58
|
const firstNonEmpty = upstreamLines
|
|
58
59
|
.map((line) => stripTerminalSequences(line).trim())
|
|
59
60
|
.find((line) => line !== "");
|
|
@@ -143,9 +144,6 @@ export function isMcpTool(toolName) {
|
|
|
143
144
|
toolName === "list_mcp_resource_templates");
|
|
144
145
|
}
|
|
145
146
|
function shouldInterceptTool(toolName, options) {
|
|
146
|
-
if (options?.catchAll === true) {
|
|
147
|
-
return options.match !== undefined ? options.match(toolName) : true;
|
|
148
|
-
}
|
|
149
147
|
if (options?.match?.(toolName)) {
|
|
150
148
|
return true;
|
|
151
149
|
}
|
|
@@ -153,7 +151,10 @@ function shouldInterceptTool(toolName, options) {
|
|
|
153
151
|
if (toolList !== undefined) {
|
|
154
152
|
return toolList.includes(toolName);
|
|
155
153
|
}
|
|
156
|
-
|
|
154
|
+
if (options?.catchAll === false) {
|
|
155
|
+
return SPECIALIZED_TOOL_SET.has(toolName) || isMcpTool(toolName);
|
|
156
|
+
}
|
|
157
|
+
return true;
|
|
157
158
|
}
|
|
158
159
|
function renderGenericResult(params) {
|
|
159
160
|
const { toolName, theme, context, result, renderOptions, defaultLevel, originalRenderCall, originalRenderResult, resolvePresentation, resolveNativeRenderer, options, } = params;
|
|
@@ -305,9 +306,21 @@ function renderGenericResult(params) {
|
|
|
305
306
|
...renderOptions,
|
|
306
307
|
expanded: effectiveExpanded,
|
|
307
308
|
};
|
|
309
|
+
let lastUpstreamComponent;
|
|
308
310
|
const lazyUpstreamComponent = {
|
|
309
311
|
render(w) {
|
|
310
|
-
|
|
312
|
+
try {
|
|
313
|
+
const upstreamContext = {
|
|
314
|
+
...context,
|
|
315
|
+
lastComponent: lastUpstreamComponent,
|
|
316
|
+
};
|
|
317
|
+
const comp = originalRenderResult(result, effectiveOptions, theme, upstreamContext);
|
|
318
|
+
lastUpstreamComponent = comp;
|
|
319
|
+
return comp.render(w);
|
|
320
|
+
}
|
|
321
|
+
catch {
|
|
322
|
+
return rawOutput !== "" ? rawOutput.split("\n") : [];
|
|
323
|
+
}
|
|
311
324
|
},
|
|
312
325
|
invalidate() { },
|
|
313
326
|
};
|