utilitas 1998.2.55 → 1998.2.57

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/index.mjs CHANGED
@@ -7,7 +7,7 @@ import _ from './lib/horizon.mjs'
7
7
  import * as alan from './lib/alan.mjs';
8
8
  import * as bee from './lib/bee.mjs';
9
9
  import * as bot from './lib/bot.mjs';
10
- import * as boxes from './lib/boxes.mjs';
10
+ import * as boxes from './lib/boxes.json' with { type: 'json' };
11
11
  import * as cache from './lib/cache.mjs';
12
12
  import * as callosum from './lib/callosum.mjs';
13
13
  import * as dbio from './lib/dbio.mjs';
package/lib/alan.mjs CHANGED
@@ -865,8 +865,9 @@ const buildPrompts = async (model, input, options = {}) => {
865
865
  };
866
866
 
867
867
  const handleToolsCall = async (msg, options) => {
868
- let [content, preRes, input, packMsg, toolsResponse, responded] = [
869
- [], [], [], null, options?.result ? options?.result.trim() : '', false
868
+ let [content, preRes, input, packMsg, toolsResponse, responded, callIdx] = [
869
+ [], [], [], null, options?.result ? options?.result.trim() : '',
870
+ false, 0,
870
871
  ];
871
872
  const resp = async m => {
872
873
  m = `\n${m}`;
@@ -913,7 +914,7 @@ const handleToolsCall = async (msg, options) => {
913
914
  }
914
915
  const name = (fn?.function || fn?.functionCall || fn)?.name;
915
916
  if (!name) { continue; }
916
- await resp(`\nName: ${name}`);
917
+ await resp(`${callIdx++ ? '\n' : ''}Name: ${name}`);
917
918
  const f = tools.find(x => insensitiveCompare(
918
919
  x.def?.function?.name || x?.def?.name, name
919
920
  ));
@@ -944,7 +945,7 @@ const handleToolsCall = async (msg, options) => {
944
945
  case GEMINI: content = [{ role: FUNC, parts: content }]; break;
945
946
  }
946
947
  }
947
- responded && await resp(`\n${TOOLS_END}`);
948
+ responded && await resp(TOOLS_END);
948
949
  }
949
950
  return {
950
951
  toolsResult: [...content.length ? preRes : [], ...content],
package/lib/boxes.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "single": {
3
+ "topLeft": "┌",
4
+ "top": "─",
5
+ "topRight": "┐",
6
+ "right": "│",
7
+ "bottomRight": "┘",
8
+ "bottom": "─",
9
+ "bottomLeft": "└",
10
+ "left": "│"
11
+ },
12
+ "double": {
13
+ "topLeft": "╔",
14
+ "top": "═",
15
+ "topRight": "╗",
16
+ "right": "║",
17
+ "bottomRight": "╝",
18
+ "bottom": "═",
19
+ "bottomLeft": "╚",
20
+ "left": "║"
21
+ },
22
+ "round": {
23
+ "topLeft": "╭",
24
+ "top": "─",
25
+ "topRight": "╮",
26
+ "right": "│",
27
+ "bottomRight": "╯",
28
+ "bottom": "─",
29
+ "bottomLeft": "╰",
30
+ "left": "│"
31
+ },
32
+ "bold": {
33
+ "topLeft": "┏",
34
+ "top": "━",
35
+ "topRight": "┓",
36
+ "right": "┃",
37
+ "bottomRight": "┛",
38
+ "bottom": "━",
39
+ "bottomLeft": "┗",
40
+ "left": "┃"
41
+ },
42
+ "singleDouble": {
43
+ "topLeft": "╓",
44
+ "top": "─",
45
+ "topRight": "╖",
46
+ "right": "║",
47
+ "bottomRight": "╜",
48
+ "bottom": "─",
49
+ "bottomLeft": "╙",
50
+ "left": "║"
51
+ },
52
+ "doubleSingle": {
53
+ "topLeft": "╒",
54
+ "top": "═",
55
+ "topRight": "╕",
56
+ "right": "│",
57
+ "bottomRight": "╛",
58
+ "bottom": "═",
59
+ "bottomLeft": "╘",
60
+ "left": "│"
61
+ },
62
+ "classic": {
63
+ "topLeft": "+",
64
+ "top": "-",
65
+ "topRight": "+",
66
+ "right": "|",
67
+ "bottomRight": "+",
68
+ "bottom": "-",
69
+ "bottomLeft": "+",
70
+ "left": "|"
71
+ },
72
+ "arrow": {
73
+ "topLeft": "↘",
74
+ "top": "↓",
75
+ "topRight": "↙",
76
+ "right": "←",
77
+ "bottomRight": "↖",
78
+ "bottom": "↑",
79
+ "bottomLeft": "↗",
80
+ "left": "→"
81
+ }
82
+ }
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": "1998.2.55",
4
+ "version": "1998.2.57",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
package/lib/utilitas.mjs CHANGED
@@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url';
2
2
  import { basename as _basename, dirname, join, sep } from 'path';
3
3
  import { promisify } from 'util';
4
4
  import { validate as verifyUuid } from 'uuid';
5
- import * as boxes from './boxes.mjs';
5
+ import boxes from './boxes.json' with { type: 'json' };
6
6
  import color from './color.mjs';
7
7
  import { assertPath, decodeBase64DataURL, readJson } from './storage.mjs';
8
8
 
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": "1998.2.55",
4
+ "version": "1998.2.57",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
@@ -13,7 +13,7 @@
13
13
  "start": "node index.mjs",
14
14
  "debug": "node --inspect --trace-warnings debug.mjs",
15
15
  "test": "node --inspect --trace-warnings test.mjs",
16
- "updep": "npx npm-check-updates -u && npm install && wget https://raw.githubusercontent.com/Marak/colors.js/master/lib/styles.js -O ./lib/style.cjs",
16
+ "updep": "npx npm-check-updates -u && npm install && wget https://raw.githubusercontent.com/Marak/colors.js/master/lib/styles.js -O ./lib/style.cjs && wget https://raw.githubusercontent.com/sindresorhus/cli-boxes/refs/heads/main/boxes.json -O ./lib/boxes.json",
17
17
  "gitsync": "( git commit -am \"Released @ `date`\" || true ) && git pull && git push",
18
18
  "pack": "./node_modules/.bin/webpack-cli --config webpack.config.mjs",
19
19
  "build": "npm run updep && ( git commit -am 'update dependencies' || true ) && node build.mjs && npm run pack",