@f5xc-salesdemos/xcsh 17.4.0 → 17.4.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.
- package/package.json +7 -7
- package/src/web/search/index.ts +3 -1
- package/src/web/search/render.ts +12 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@f5xc-salesdemos/xcsh",
|
|
4
|
-
"version": "17.4.
|
|
4
|
+
"version": "17.4.1",
|
|
5
5
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://github.com/f5xc-salesdemos/xcsh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@agentclientprotocol/sdk": "0.16.1",
|
|
48
48
|
"@mozilla/readability": "^0.6",
|
|
49
|
-
"@f5xc-salesdemos/xcsh-stats": "17.4.
|
|
50
|
-
"@f5xc-salesdemos/pi-agent-core": "17.4.
|
|
51
|
-
"@f5xc-salesdemos/pi-ai": "17.4.
|
|
52
|
-
"@f5xc-salesdemos/pi-natives": "17.4.
|
|
53
|
-
"@f5xc-salesdemos/pi-tui": "17.4.
|
|
54
|
-
"@f5xc-salesdemos/pi-utils": "17.4.
|
|
49
|
+
"@f5xc-salesdemos/xcsh-stats": "17.4.1",
|
|
50
|
+
"@f5xc-salesdemos/pi-agent-core": "17.4.1",
|
|
51
|
+
"@f5xc-salesdemos/pi-ai": "17.4.1",
|
|
52
|
+
"@f5xc-salesdemos/pi-natives": "17.4.1",
|
|
53
|
+
"@f5xc-salesdemos/pi-tui": "17.4.1",
|
|
54
|
+
"@f5xc-salesdemos/pi-utils": "17.4.1",
|
|
55
55
|
"@sinclair/typebox": "^0.34",
|
|
56
56
|
"@xterm/headless": "^6.0",
|
|
57
57
|
"ajv": "^8.18",
|
package/src/web/search/index.ts
CHANGED
|
@@ -292,7 +292,9 @@ export const webSearchCustomTool: CustomTool<typeof webSearchSchema, SearchRende
|
|
|
292
292
|
renderResult(result, options: RenderResultOptions, theme: Theme) {
|
|
293
293
|
return renderSearchResult(result, options, theme);
|
|
294
294
|
},
|
|
295
|
-
|
|
295
|
+
|
|
296
|
+
mergeCallAndResult: true as const,
|
|
297
|
+
} as CustomTool<typeof webSearchSchema, SearchRenderDetails> & { mergeCallAndResult: true };
|
|
296
298
|
|
|
297
299
|
export function getSearchTools(): CustomTool<any, any>[] {
|
|
298
300
|
return [webSearchCustomTool];
|
package/src/web/search/render.ts
CHANGED
|
@@ -101,6 +101,10 @@ export function renderSearchResult(
|
|
|
101
101
|
return renderFallbackText(rawText, options.expanded, theme);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
const searchQueries = Array.isArray(response.searchQueries)
|
|
105
|
+
? response.searchQueries.filter(item => typeof item === "string")
|
|
106
|
+
: [];
|
|
107
|
+
|
|
104
108
|
const verbose = getVerboseSetting();
|
|
105
109
|
if (!verbose) {
|
|
106
110
|
const searches = response.usage?.searchRequests ?? 1;
|
|
@@ -111,17 +115,20 @@ export function renderSearchResult(
|
|
|
111
115
|
? `${Math.round(response.durationMs / 1000)}s`
|
|
112
116
|
: `${Math.round(response.durationMs)}ms`
|
|
113
117
|
: "";
|
|
114
|
-
const
|
|
115
|
-
|
|
118
|
+
const queryPreview = args?.query
|
|
119
|
+
? truncateToWidth(args.query, 80)
|
|
120
|
+
: searchQueries[0]
|
|
121
|
+
? truncateToWidth(searchQueries[0], 80)
|
|
122
|
+
: undefined;
|
|
123
|
+
const header = queryPreview ? `Web Search("${queryPreview}")` : "Web Search";
|
|
124
|
+
const summary = ` \u23BF Did ${searches} search${plural}${dur ? ` in ${dur}` : ""}`;
|
|
125
|
+
return new Text(`${theme.fg("text", header)}\n${theme.fg("dim", summary)}`, 0, 0);
|
|
116
126
|
}
|
|
117
127
|
|
|
118
128
|
const sources = Array.isArray(response.sources) ? response.sources : [];
|
|
119
129
|
const sourceCount = sources.length;
|
|
120
130
|
const citations = Array.isArray(response.citations) ? response.citations : [];
|
|
121
131
|
const citationCount = citations.length;
|
|
122
|
-
const searchQueries = Array.isArray(response.searchQueries)
|
|
123
|
-
? response.searchQueries.filter(item => typeof item === "string")
|
|
124
|
-
: [];
|
|
125
132
|
const provider = response.provider;
|
|
126
133
|
|
|
127
134
|
// Get answer text
|