utilitas 2001.1.110 → 2001.1.112

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/lib/alan.mjs CHANGED
@@ -806,6 +806,7 @@ const handleToolsCall = async (msg, options) => {
806
806
  const output = JSON.stringify((await f?.func(input)) ?? OK);
807
807
  content.push(packMsg(output));
808
808
  await resp(f.showRes ? `Output: ${output}` : `Status: OK`);
809
+ log(`Tool: ${name}(${JSON.stringify(input)}): ${output}`);
809
810
  } catch (err) {
810
811
  const rt = `Failed: ${err.message}`;
811
812
  content.push(packMsg(rt, true));
package/lib/manifest.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  const manifest = {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "2001.1.110",
4
+ "version": "2001.1.112",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
package/lib/web.mjs CHANGED
@@ -195,6 +195,8 @@ const search = async (query, options = {}) => {
195
195
  + `&q=${encodeURIComponent(query)}&num=${num}&start=${start}`
196
196
  + (options?.image ? `&searchType=image` : '');
197
197
  var resp = await get(url, { encode: _JSON, ...options || {} });
198
+ assert(!resp?.content?.error?.message, resp?.content?.error?.message
199
+ || 'Failed to use Google Search API.');
198
200
  return options?.raw ? resp.content : {
199
201
  totalResults: resp?.content?.searchInformation?.totalResults || 0,
200
202
  startIndex: resp?.content?.queries?.request?.[0]?.startIndex || 1,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "2001.1.110",
4
+ "version": "2001.1.112",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",