pinokiod 8.3.29 → 8.3.30

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "8.3.29",
3
+ "version": "8.3.30",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1008,7 +1008,9 @@
1008
1008
  api.refresh = () => render();
1009
1009
  // the modes and choosing one, for the row that names them all (agent-bar-modes.js)
1010
1010
  api.modes = () => Object.keys(ITEMS).map((key) => ({ key, label: ITEMS[key].label }));
1011
- api.choose = (key) => { setItem(key); focusInputAtEnd(); };
1011
+ // (This can be the first thing done in the bar, so the agents are read here
1012
+ // too: going to the text afterwards no longer does it, the bar is already in use.)
1013
+ api.choose = (key) => { loadTools(); setItem(key); focusInputAtEnd(); };
1012
1014
 
1013
1015
  function toggleMenu(which) {
1014
1016
  if (state.busy) return;
@@ -1454,6 +1456,9 @@
1454
1456
 
1455
1457
  render();
1456
1458
  syncActive();
1459
+ // The agents are read as the bar goes in, so the one that is remembered is
1460
+ // shown from the start, not only once the bar is first used.
1461
+ loadTools();
1457
1462
  return true;
1458
1463
  }
1459
1464
 
@@ -131,6 +131,20 @@ test('a click on a row\'s button points the bar at that app and does not open th
131
131
  assert.deepEqual(p.posts, [])
132
132
  })
133
133
 
134
+ test('the remembered agent is shown as soon as the page opens, before the bar is used', async (t) => {
135
+ const p = await home(t)
136
+ assert.equal(p.bar.tool().value, 'codex')
137
+ assert.match(p.root.querySelector('.agent-bar__agent').textContent, /Codex/)
138
+ assert.equal(p.root.dataset.engaged, 'false')
139
+ })
140
+
141
+ test('the click is the first thing done in the bar: the remembered agent is shown, not only used', async (t) => {
142
+ const p = await home(t)
143
+ await p.click(p.askButton('demo'))
144
+ assert.equal(p.bar.tool().value, 'codex')
145
+ assert.match(p.root.querySelector('.agent-bar__agent').textContent, /Codex/)
146
+ })
147
+
134
148
  test('the open view has a chip with the app\'s name and icon; its x makes it an ordinary Ask', async (t) => {
135
149
  const p = await home(t)
136
150
  await p.click(p.askButton('demo'))